Solr Searching on other fields which are not in query

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Solr Searching on other fields which are not in query

RaviWhy
Hi,

I have a data set with the following schema.

PersonName:Text
AnimalName:Text
PlantName:Text

<.... lot more attributes about each of them like nick name, animal nick name, plant generic name etc which are multually exclusive>
UniqueId:long

For each of the document data set, there will be only one value of the above three.

In my solr query from client

I am using AnimalName:German Shepard.

The return result contains
PersonName with 'Shepard' in it, even though I am querying on AnimalName field.
Can anyone point me whats happening and how to prevent scanning other columns/fields.

I appreciate your help.

Thanks
Ravi
Reply | Threaded
Open this post in threaded view
|

Re: Solr Searching on other fields which are not in query

Jorge Solari
Your query

AnimalName:German Shepard.

means

AnimalName:German <defaultField>:Shepard.

whichever the defaultField is

Try with
AnimalName:"German Shepard"

or

AnimalName:German AND AnimalName:Shepard.



On Thu, Oct 30, 2008 at 12:58 PM, Yerraguntla <[hidden email]> wrote:

>
> Hi,
>
> I have a data set with the following schema.
>
> PersonName:Text
> AnimalName:Text
> PlantName:Text
>
> <.... lot more attributes about each of them like nick name, animal nick
> name, plant generic name etc which are multually exclusive>
> UniqueId:long
>
> For each of the document data set, there will be only one value of the
> above
> three.
>
> In my solr query from client
>
> I am using AnimalName:German Shepard.
>
> The return result contains
> PersonName with 'Shepard' in it, even though I am querying on AnimalName
> field.
> Can anyone point me whats happening and how to prevent scanning other
> columns/fields.
>
> I appreciate your help.
>
> Thanks
> Ravi
>
> --
> View this message in context:
> http://www.nabble.com/Solr-Searching-on-other-fields-which-are-not-in-query-tp20249798p20249798.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr Searching on other fields which are not in query

RaviWhy
Hmm,

I dont have any <defaultField> defined in the schema.xml.
Can you give the exact syntax how it looks like in schema.xml

I have <defaultSearchField>text</defaultSearchField>.
Does it mean if sufficient requested count not available, it looks for the search string in any of the text fields that are indexed?

Thanks
Ravi

Jorge Solari wrote
Your query

AnimalName:German Shepard.

means

AnimalName:German <defaultField>:Shepard.

whichever the defaultField is

Try with
AnimalName:"German Shepard"

or

AnimalName:German AND AnimalName:Shepard.



On Thu, Oct 30, 2008 at 12:58 PM, Yerraguntla <raveendray@yahoo.com> wrote:

>
> Hi,
>
> I have a data set with the following schema.
>
> PersonName:Text
> AnimalName:Text
> PlantName:Text
>
> <.... lot more attributes about each of them like nick name, animal nick
> name, plant generic name etc which are multually exclusive>
> UniqueId:long
>
> For each of the document data set, there will be only one value of the
> above
> three.
>
> In my solr query from client
>
> I am using AnimalName:German Shepard.
>
> The return result contains
> PersonName with 'Shepard' in it, even though I am querying on AnimalName
> field.
> Can anyone point me whats happening and how to prevent scanning other
> columns/fields.
>
> I appreciate your help.
>
> Thanks
> Ravi
>
> --
> View this message in context:
> http://www.nabble.com/Solr-Searching-on-other-fields-which-are-not-in-query-tp20249798p20249798.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr Searching on other fields which are not in query

RaviWhy
Never mind,
I understand now.

  I have <defaultSearchField>text</defaultSearchField>.

I was searching on a string field with space in it and with no quotes.

This is causing to scan for text fields(since default search field is text) in the schema.
Also in my schema there is an indexed field(AnimalNameText) which is not populated which is a text field.

After I populate the text field, I get only the results I am expecting.

Thanks for the pointer Jorge !




Yerraguntla wrote
Hmm,

I dont have any <defaultField> defined in the schema.xml.
Can you give the exact syntax how it looks like in schema.xml

I have <defaultSearchField>text</defaultSearchField>.
Does it mean if sufficient requested count not available, it looks for the search string in any of the text fields that are indexed?

Thanks
Ravi

Jorge Solari wrote
Your query

AnimalName:German Shepard.

means

AnimalName:German <defaultField>:Shepard.

whichever the defaultField is

Try with
AnimalName:"German Shepard"

or

AnimalName:German AND AnimalName:Shepard.



On Thu, Oct 30, 2008 at 12:58 PM, Yerraguntla <raveendray@yahoo.com> wrote:

>
> Hi,
>
> I have a data set with the following schema.
>
> PersonName:Text
> AnimalName:Text
> PlantName:Text
>
> <.... lot more attributes about each of them like nick name, animal nick
> name, plant generic name etc which are multually exclusive>
> UniqueId:long
>
> For each of the document data set, there will be only one value of the
> above
> three.
>
> In my solr query from client
>
> I am using AnimalName:German Shepard.
>
> The return result contains
> PersonName with 'Shepard' in it, even though I am querying on AnimalName
> field.
> Can anyone point me whats happening and how to prevent scanning other
> columns/fields.
>
> I appreciate your help.
>
> Thanks
> Ravi
>
> --
> View this message in context:
> http://www.nabble.com/Solr-Searching-on-other-fields-which-are-not-in-query-tp20249798p20249798.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr Searching on other fields which are not in query

Jorge Solari
In reply to this post by RaviWhy
I didn't mean with <defaultField> that it was the way to define the default
field it in the schema, only a generic way to say "default field name".

The default field name, seems to be "text" in your case.

If the search query doesn't say on which field to search, the word will be
searched in that field.

in the query

AnimalName:German Shepard

you are saying:

"search the word "German" in the field "AnimalName" and the word "Shepard"
in the default field"

I think that that the search you want to do is

AnimalName:German AND AnimalName:Shepard

I don't know if there is a way to say to solr to search on all fields.

you may be copying the content of other fields to the "text" field.

See if there is something like

<copyField source="*" dest="text"/>

in the schema file.

Jorge


On Thu, Oct 30, 2008 at 3:13 PM, Yerraguntla <[hidden email]> wrote:

>
> Hmm,
>
> I dont have any <defaultField> defined in the schema.xml.
> Can you give the exact syntax how it looks like in schema.xml
>
> I have <defaultSearchField>text</defaultSearchField>.
> Does it mean if sufficient requested count not available, it looks for the
> search string in any of the text fields that are indexed?
>
> Thanks
> Ravi
>
>
> Jorge Solari wrote:
> >
> > Your query
> >
> > AnimalName:German Shepard.
> >
> > means
> >
> > AnimalName:German <defaultField>:Shepard.
> >
> > whichever the defaultField is
> >
> > Try with
> > AnimalName:"German Shepard"
> >
> > or
> >
> > AnimalName:German AND AnimalName:Shepard.
> >
> >
> >
> > On Thu, Oct 30, 2008 at 12:58 PM, Yerraguntla <[hidden email]>
> > wrote:
> >
> >>
> >> Hi,
> >>
> >> I have a data set with the following schema.
> >>
> >> PersonName:Text
> >> AnimalName:Text
> >> PlantName:Text
> >>
> >> <.... lot more attributes about each of them like nick name, animal nick
> >> name, plant generic name etc which are multually exclusive>
> >> UniqueId:long
> >>
> >> For each of the document data set, there will be only one value of the
> >> above
> >> three.
> >>
> >> In my solr query from client
> >>
> >> I am using AnimalName:German Shepard.
> >>
> >> The return result contains
> >> PersonName with 'Shepard' in it, even though I am querying on AnimalName
> >> field.
> >> Can anyone point me whats happening and how to prevent scanning other
> >> columns/fields.
> >>
> >> I appreciate your help.
> >>
> >> Thanks
> >> Ravi
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Solr-Searching-on-other-fields-which-are-not-in-query-tp20249798p20249798.html
> >> Sent from the Solr - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Solr-Searching-on-other-fields-which-are-not-in-query-tp20249798p20252475.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr Searching on other fields which are not in query

Norberto Meijome-6
On Thu, 30 Oct 2008 15:50:58 -0300
"Jorge Solari" <[hidden email]> wrote:

> <copyField source="*" dest="text"/>
>
> in the schema file.

or use Dismax query handler.
b

_________________________
{Beto|Norberto|Numard} Meijome

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

I speak for myself, not my employer. Contents may be hot. Slippery when wet. Reading disclaimers makes you go blind. Writing them is worse. You have been Warned.