lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Sokolov <msoko...@gmail.com>
Subject Re: Not getting desired result through TermQuery
Date Wed, 18 Jul 2018 19:22:11 GMT
It's impossible to tell for sure from the info you provided -- attachments
are not included in messages on this mailing list - but my guess is that
when you use the QueryParser api you are getting a query that has the
benefit of text processing using an Analyzer (lower-casing and other text
transformations are done by an Analyzer), but TermQuery just matches
exactly the term you give it, without any such processing.

On Mon, Jul 16, 2018 at 11:02 AM Ashish Parab <ashish.parab23@gmail.com>
wrote:

> Hi Team,
>
> I am new to Lucene and been exploring Lucene 7.4.0  for past few months.
>
> please take a look at attached IndexFiles.java, in which I am indexing all
> the files present under specified folder. also for every document, a field
> namely ashish is stored.
>
> now the indexing is ready, I am trying to search it via TermQuery api.
> code(SearchFiles_Mine.java) for the same is also attached.
>
>
> My issue is when I use TermQuery I get 0 hit where as if same thing is
> tried via QueryParser api it gives 10 hit.
>
> why is this happening? will you explain the functionality TermQuery API,
> in the context of my code ?
>
> regards,
> Ashish Parab
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org

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