lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <>
Subject Re: Quoted search on Analyzed fields
Date Tue, 29 Nov 2011 15:31:17 GMT
if you use standardanalyzer it will break "john doe" into 2 tokens and
form a phrase query.
if you want to do phrase queries, don't set the indexoptions to
DOCS_ONLY. otherwise they won't work.

if what you want is for "john doe" to only be 1 term without
positions, then use KeywordAnalyzer, and DOCS_ONLY is then ok because
you don't need any positions.

On Tue, Nov 29, 2011 at 10:18 AM, Mihai Caraman <> wrote:
> field = new Field("author",(author).toLowerCase(),Field.Store.NO,
> Field.Index.NOT_ANALYZED);
>            field.setIndexOptions(FieldInfo.IndexOptions.DOCS_ONLY);
>            field.setOmitNorms(true);
> When in the above configuration i switched from NOT_ANALYZED to ANALYZED,
> luke's results for author:"john doe" stopped showing(after rebuilding the
> index). Why?
> Also, how can, on the same index, luke show me results for author:"john
> doe"(using not_analyzed), but when i debug the IndexSearcher which receives
> a query parsed with the same standardanalyzer as at indexing time(and seems
> to be correct), returns no results?!
> Thank you,
> Mihai C.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message