lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shai Erera <ser...@gmail.com>
Subject Re: Searching doubt
Date Tue, 04 Aug 2009 06:54:46 GMT
I don't see that you use the Analyzer anywhere (i.e. it's created by not
used?).

Also, the wildcard query you create may be very inefficient, as it will
expand all the terms under the DEFAULT_FIELD. If the DEFAULT_FIELD is the
field where all your "default searchable" terms are indexed, there could be
tens of thousands to millions of terms (depends on how many documents you
add).

Also, what exactly do you expect that this query will return? All docs? Is
the word "aboutus" there?

Maybe you should do the following:
WildcardQuery wq = new WildcardQuery(new Term(DEFAULT_FIELD, "about"));
searcher.search(wq);

This should work, if the urls are indexed under the DEFAULT_FIELD.

Shai

On Tue, Aug 4, 2009 at 9:46 AM, m.harig <m.harig@gmail.com> wrote:

>
> Thanks
>
>           This is my codw snippet
>
>               IndexSearcher searcher = new IndexSearcher(indexDir);
>                Analyzer analyzer = new StopAnalyzer();
>
>                WildcardQuery query = new WildcardQuery(new
> Term(DEFAULT_FIELD));
>                searcher.search(query);
>
>  but its returning 0 hits as results , where am i wrong? please help me out
> of this.
>
> --
> View this message in context:
> http://www.nabble.com/Searching-doubt-tp24802552p24803073.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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