我試圖在Lucene索引上搜索一些我知道索引但是結果不是很好的特定單詞。在Lucene索引中搜索特定術語
如何執行對特定術語(「129202」)的查詢?我試過在字符串的開頭添加加號,但它不起作用。
我的查詢:
QueryParser q = new QueryParser(Version.LUCENE_42, "tags", new SimpleAnalyzer(Version.LUCENE_42));
Query query = q.parse("sapatilha feminina ramarim 129202 cinza");
下面是一個文件(XML)的索引,我想
<?xml version="1.0" encoding="UTF-8"?>
<product>
<tags>
<tag>Sapatilha Pedras Preto</tag>
<tag>ramarin</tag>
<tag>ramarin 129202</tag>
<tag>preto</tag>
</tags>
<id>71</id>
<url>http://www.dafiti.com.br/Sapatilha-Pedras-Preto-1135428.html</url>
</product>
「的結果不是很好「 - 你需要比這更具體。 – mindas