Again there is nothing wrong with the quotes: its instead how you are
configuring the analysis for this field.

If you put stuff in quotes and your analyzer breaks it into multiple
tokens, then queryparser forms a phrase query. You must index
positions to support phrase queries.

Normally DOCS_ONLY is only used for fields that contain a *single
term*, like a numeric field. If you want to exclude positions for a
field but at the same time allow tokenized queries against it like you
are doing, then you need to adjust your queryparsing to do the right
thing if someone enters quoted text like "john doe", such as forming a
boolean query (john AND doe) instead.

The way to do this is to subclass the queryparser and do something like:
@Override
protected Query getFieldQuery(String field, String queryText, boolean
quoted)  throws ParseException {
 if (quoted && field.equals("myfieldwithoutpositions") {
    // my special logic to form boolean queries or something else
 } else {
    return super.getFieldQuery(field, queryText, quoted);
 }
}


On Tue, Nov 29, 2011 at 10:58 AM, Mihai Caraman <caraman.mi...@gmail.com> wrote:
> Still no difference, it may be because of some other hidden
> bug.<java-user-h...@lucene.apache.org>Anyway, adding freq and
> positions will be a no - no because of space :) so
> bye bye quotes.
>
> Thank you
>



-- 
lucidimagination.com

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

Reply via email to