You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by jyn7 <jy...@gmail.com> on 2011/08/18 16:22:35 UTC

Exact Match using Copy Fields

Hi,

I am trying to achieve an exact match search on a text field. I am using a
copy field and copying it to a string and using that for the search.

 <field name="imprint" type="text" indexed="true" stored="true"/>
 <field name="author" type="text" indexed="true" stored="true"/>
 <field name="author_exact" type="string" indexed="true" stored="false"/>
 <field name="imprint_exact" type="string" indexed="true" stored="false"/>

 <copyField source="author" dest="author_exact"/>
 <copyField source="imprint" dest="imprint_exact"/>

and now I want to do an exact match on the imprint field and am trying to
search using the below, and the results are not limited to imprint_exact, I
even get the results with author_exact having the queried value.
facet=true&qf=imprint_exact&fl=*,score&fq=published_on:[* TO NOW]&q=Cris
Williamson&start=0&rows=10

Can anyone help me correct this?

Thanks.

--
View this message in context: http://lucene.472066.n3.nabble.com/Exact-Match-using-Copy-Fields-tp3265027p3265027.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Exact Match using Copy Fields

Posted by jyn7 <jy...@gmail.com>.
Thanks Juan. It did help :)

--
View this message in context: http://lucene.472066.n3.nabble.com/Exact-Match-using-Copy-Fields-tp3265027p3284026.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Exact Match using Copy Fields

Posted by Juan Grande <ju...@gmail.com>.
Hi, are you sure you're using dismax query parser? Make sure you have the
parameter "defType=dismax" in your request.

*Juan*



On Thu, Aug 18, 2011 at 11:22 AM, jyn7 <jy...@gmail.com> wrote:

> Hi,
>
> I am trying to achieve an exact match search on a text field. I am using a
> copy field and copying it to a string and using that for the search.
>
>  <field name="imprint" type="text" indexed="true" stored="true"/>
>  <field name="author" type="text" indexed="true" stored="true"/>
>  <field name="author_exact" type="string" indexed="true" stored="false"/>
>  <field name="imprint_exact" type="string" indexed="true" stored="false"/>
>
>  <copyField source="author" dest="author_exact"/>
>  <copyField source="imprint" dest="imprint_exact"/>
>
> and now I want to do an exact match on the imprint field and am trying to
> search using the below, and the results are not limited to imprint_exact, I
> even get the results with author_exact having the queried value.
> facet=true&qf=imprint_exact&fl=*,score&fq=published_on:[* TO NOW]&q=Cris
> Williamson&start=0&rows=10
>
> Can anyone help me correct this?
>
> Thanks.
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Exact-Match-using-Copy-Fields-tp3265027p3265027.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>