This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lucene Query.toString returns blank/empty value

 
Ajay Singh
Ranch Hand
Posts: 105
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i am trying to use Lucene for indexing and searching long terms.My terms are of the form A.B.C.D in my documents(Example "Considering.think.Considering.Cognizer.community.Considering.aux.would" is a term which is indexed).I am able to index terms of such patterns.But retrieving does not work for some of these patterns.I am using StandardAnalyzer while indexing the documents and using the same Analyzer for retrieving.While debugging i found that query.toString is blank(empty) for the patterns which are not being searched.Otherwise some values comes in the Sysout in line number 3 below of my term search logic.

QueryParser queryParser = new QueryParser(Version.LUCENE_30,"TM", standardAnalyzer);
Query query= queryParser.parse("\"" + termToBeSearched + "\"");
System.out.println("===================================================Query :: "+query.toString());
System.out.println("=======================Query Class---->"+query.getClass());


Pattern Number 1:-
"Considering.think.Considering.Cognizer.community.Considering.aux.would"

Pattern Number 2:-
"Prohibiting.deny.Prohibiting.StateUNDRofUNDRaffairs.access.Prohibiting.StateUNDRofUNDRaffairs.Descriptor.church.Prohibiting.Explanation.premise.Prohibiting.Explanation.Descriptor.school.Prohibiting.Explanation.view.Prohibiting.Explanation.Characteristic.film.Prohibiting.Explanation.KindUNDRof.public"

The query.toString has some values for Pattern no 1( and is able to search it) but is empty/blank for Pattern number 2 while searching although indexing happens for both. What am i doing wrong? is there any limit in lucene regarding term length.Even some of the bigger length terms compared to the second pattern is being searched successfully,so i dont think that is the case.Please guide me.


Thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic