Hi,

I'm trying to figure out why phrase matching on a text field only works
some of the time.

I have a SOLR index containing a document titled "FUTURE DIRECTIONS FOR
INTEGRATED CATCHMENT".  The "FOR" seems to be causing a problem...

The title field is indexed as both s_title and t_title (string and text,
as defined in the demo schema), thus:

    <field name="title" type="string" indexed="false" stored="false"
        multiValued="false" />
    <field name="s_title" type="string" indexed="true" stored="true"
        multiValued="false" />
    <field name="t_title" type="text" indexed="true" stored="false"
        multiValued="false" />
    <copyField source="title" dest="s_title" />
    <copyField source="title" dest="t_title" />

I can match the document with an exact query on the string:

    q=s_title:"FUTURE DIRECTIONS FOR INTEGRATED CATCHMENT"

I can match the document with this phrase query on the text:

    q=t_title:"future directions"

which uses the parsedquery shown by "&debugQuery=true":

    <str name="rawquerystring">t_title:"future directions"</str>
    <str name="querystring">t_title:"future directions"</str>
    <str name="parsedquery">PhraseQuery(t_title:"futur direct")</str>
    <str name="parsedquery_toString">t_title:"futur direct"</str>

Similarly, I can match the document with this query:

    q=t_title:"integrated catchment"

which uses the parsedquery shown by "&debugQuery=true":

    <str name="rawquerystring">t_title:"integrated catchment"</str>
    <str name="querystring">t_title:"integrated catchment"</str>
    <str name="parsedquery">PhraseQuery(t_title:"integr catchment")</str>
    <str name="parsedquery_toString">t_title:"integr catchment"</str>

But I can not match the document with the query:

    q=t_title:"future directions for integrated catchment"

which uses the phrase query shown by "&debugQuery=true":

    <str name="rawquerystring">
        t_title:"future directions for integrated catchment"</str>
    <str name="querystring">
        t_title:"future directions for integrated catchment"</str>
    <str name="parsedquery">
        PhraseQuery(t_title:"futur direct integr catchment")</str>
    <str name="parsedquery_toString">
        t_title:"futur direct integr catchment"</str>

Any wisdom gratefully accepted.

Cheers,


-- 
Phil

640K ought to be enough for anybody.
        -- Bill Gates, in 1981

Reply via email to