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 James Grant <Ja...@semantico.com> on 2009/06/03 14:09:10 UTC
Strange behaviour with copyField
I've been hitting my head against a wall all morning trying to figure
this out and haven't managed to get anywhere and wondered if anybody
here can help.
I have defined a field type
<fieldType name="text_au" class="solr.TextField"
positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.LowerCaseTokenizerFactory" />
</analyzer>
</fieldType>
I have two fields
<field name="au" type="text_au" indexed="true" stored="true"
required="false" multiValued="true"/>
<field name="author" type="text_au" indexed="true" stored="false"
multiValued="true"/>
and a copyField line
<copyField source="au" dest="author" />
The idea is to allow searching for authors so a search for
"author:(Hobbs A.U.)" will match the au field value "Hobbs A. U."
(notice the space).
However the query "au:(Hobbs A.U.)" matches and the the query
"author:(Hobbs A.U.)" does not.
Any ideas?
I'm using a Solr 1.4 snapshot
Regards
James
Re: Strange behaviour with copyField
Posted by Otis Gospodnetic <ot...@yahoo.com>.
James,
I don't see the error, but this is exactly what Solr Admin's analysis page will quickly help you with! :)
Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
----- Original Message ----
> From: James Grant <Ja...@semantico.com>
> To: solr-user@lucene.apache.org
> Sent: Wednesday, June 3, 2009 8:09:10 AM
> Subject: Strange behaviour with copyField
>
> I've been hitting my head against a wall all morning trying to figure this out
> and haven't managed to get anywhere and wondered if anybody here can help.
>
> I have defined a field type
>
>
>
>
>
>
>
> I have two fields
>
>
> multiValued="true"/>
>
> multiValued="true"/>
>
> and a copyField line
>
>
>
> The idea is to allow searching for authors so a search for "author:(Hobbs A.U.)"
> will match the au field value "Hobbs A. U." (notice the space).
>
> However the query "au:(Hobbs A.U.)" matches and the the query "author:(Hobbs
> A.U.)" does not.
>
> Any ideas?
>
> I'm using a Solr 1.4 snapshot
>
> Regards
>
> James
RE: Strange behaviour with copyField
Posted by "Radha C." <cr...@ceiindia.com>.
What is the defaultOperator set in your solrconfig.xml? Are you sure that it
matches for au and not author?
-----Original Message-----
From: Grant Ingersoll [mailto:gsingers@apache.org]
Sent: Thursday, June 04, 2009 2:53 AM
To: solr-user@lucene.apache.org
Subject: Re: Strange behaviour with copyField
On Jun 3, 2009, at 5:09 AM, James Grant wrote:
> I've been hitting my head against a wall all morning trying to
> figure this out and haven't managed to get anywhere and wondered if
> anybody here can help.
>
> I have defined a field type
>
> <fieldType name="text_au" class="solr.TextField"
> positionIncrementGap="100">
> <analyzer>
> <tokenizer class="solr.LowerCaseTokenizerFactory" />
> </analyzer>
> </fieldType>
>
> I have two fields
>
> <field name="au" type="text_au" indexed="true" stored="true"
> required="false" multiValued="true"/>
> <field name="author" type="text_au" indexed="true" stored="false"
> multiValued="true"/>
I don't see the difference, as they are the same FieldType for each
field, text_au. Is this a typo or am I missing something?
>
>
> and a copyField line
>
> <copyField source="au" dest="author" />
>
> The idea is to allow searching for authors so a search for "author:
> (Hobbs A.U.)" will match the au field value "Hobbs A. U." (notice
> the space).
What would lower casing do for handling the space?
>
>
> However the query "au:(Hobbs A.U.)" matches and the the query
> "author:(Hobbs A.U.)" does not.
>
> Any ideas?
>
How are you indexing?
--------------------------
Grant Ingersoll
http://www.lucidimagination.com/
Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids)
using Solr/Lucene:
http://www.lucidimagination.com/search
Re: Strange behaviour with copyField
Posted by Grant Ingersoll <gs...@apache.org>.
On Jun 3, 2009, at 5:09 AM, James Grant wrote:
> I've been hitting my head against a wall all morning trying to
> figure this out and haven't managed to get anywhere and wondered if
> anybody here can help.
>
> I have defined a field type
>
> <fieldType name="text_au" class="solr.TextField"
> positionIncrementGap="100">
> <analyzer>
> <tokenizer class="solr.LowerCaseTokenizerFactory" />
> </analyzer>
> </fieldType>
>
> I have two fields
>
> <field name="au" type="text_au" indexed="true" stored="true"
> required="false" multiValued="true"/>
> <field name="author" type="text_au" indexed="true" stored="false"
> multiValued="true"/>
I don't see the difference, as they are the same FieldType for each
field, text_au. Is this a typo or am I missing something?
>
>
> and a copyField line
>
> <copyField source="au" dest="author" />
>
> The idea is to allow searching for authors so a search for "author:
> (Hobbs A.U.)" will match the au field value "Hobbs A. U." (notice
> the space).
What would lower casing do for handling the space?
>
>
> However the query "au:(Hobbs A.U.)" matches and the the query
> "author:(Hobbs A.U.)" does not.
>
> Any ideas?
>
How are you indexing?
--------------------------
Grant Ingersoll
http://www.lucidimagination.com/
Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids)
using Solr/Lucene:
http://www.lucidimagination.com/search