• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Mike London

Lucene Query.toString returns blank/empty value

Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:-

Pattern Number 2:-

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.
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic