lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Richmond" <richmondm...@gmail.com>
Subject Re: Lucene query question
Date Wed, 10 May 2006 11:56:01 GMT
Mr. Gospodnetic,

Thanks for the quick response.  You make a good point about the field
being tokenized, and I initially had the e-mail field UN_TOKENIZED but
it did not change the result of the query (my example search was still
failing).  Do you have any ideas on what could be causing that?


Thanks again,

--Mike




On 5/10/06, Otis Gospodnetic <otis_gospodnetic@yahoo.com> wrote:
> Mike,
>
> Do you really want to tokenize your emails?  StandardAnalyzer may in fact recognize email
addresses and leave them as one token, but it would probably be better practice to make that
email field UN_TOKENIZED.
>
> Most of the time when people have trouble finding a Document they _know_ is in the index,
the problem involves Analyzers, and sometimes the QueryParser+Analyzer combination.  Grab
Lucene in Action code and run the app that will take your input and pass it through various
Analyzers to get an idea what's happening with your test field.
>
> Otis
>
> ----- Original Message ----
> From: Mike Richmond <richmondmike@gmail.com>
> To: java-user@lucene.apache.org
> Sent: Tuesday, May 9, 2006 10:18:29 PM
> Subject: Lucene query question
>
> I am new to Lucene, but the behavior that I am seeing does not seem to
> make sense to me.  I am using the latest version of Lucene (1.9.1) and
> executing the following code below which creates an index with a
> single document and only one field (named "test") with a value of
> "richmondmike@gmail.com".
>
> If I use Luke to search through this newly created index using a query such as:
> "test:richmondmike@gmail.com" I do not get any matches.  However, if
> using Luke I browse to the document and click the "Reconstruct & Edit"
> button then without making any changes save the document I can then
> rerun the same query and it will find the document!
>
> Is this normal?  The only thing I can think of is that the index was
> created with Lucene 1.9.1 and is being searched using Luke (which was
> probably written using an older version of Lucene).  Any help would be
> greatly appreciated.
>
>
> Thanks in advance,
>
> Mike
>
> -------------------CODE SNIPPET BELOW-----------------
>
>
> IndexWriter iw = new IndexWriter("index", new StandardAnalyzer(), true);
> Document d = new Document();
>
> d.add( new Field("test", "richmondmike@gmail.com", Field.Store.YES,
> Field.Index.TOKENIZED));
>
> iw.addDocument( d );
>
> iw.close();
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message