lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peru Redmi <perumyph...@gmail.com>
Subject Understanding Query Parser Behavior
Date Mon, 21 Nov 2016 15:44:00 GMT
Hello All ,

Could someone explain *QueryParser* behavior on these cases

1. While Indexing ,

Document doc = new Document();

doc.add(new Field("*Field*", "*http://www.google.com
<http://www.google.com/>*", Field.Store.YES, Field.Index.ANALYZED));

      index has *two* terms - *http* & *www.google.com
<http://www.google.com/>*

*2.* While searching ,

Analyzer anal = new *ClassicAnalyzer*(Version.LUCENE_30, new
StringReader(""));
QueryParser parser=new *MultiFieldQueryParser*(Version.LUCENE_30, new
String[]{"*Field*"},anal);
Query query = parser.parse("*http://www.google.com <http://www.google.com/>*
");

Now , query has *three *terms  -  (Field:http) *(Field://)* (Field:
www.google.com)


i) Why I have got 3 terms while parsing , and 2 terms on indexing (Using
same ClassicAnalyzer in both cases ) ?

ii) is this expected behavior of ClassicAnalyzer(Version.LUCENE_30) on
Parser ?

iii) what should be done to avoid query part *(Field://) *?

Thanks,
Peru.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message