SOLR QUERY

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

SOLR QUERY

moizhb
Hello there,

I am pretty much new to SOLR and my question is about querying SOLR.
Beginning from what I am doing:

I have updated the index with the following SOLR document:
*<add>
    <doc>
        <field name="id">name-2</field>
        <field name="ap_firstName">Moiz</field>
**        <field name="ap_lastName">Bhukhiya</field>*
*    </doc>
</add>

*I know how to search for a particular field like
*q=ap_firstName:Moiz*which result this document. But how do I search
in the entire document? I
tried *q=Moiz* but it didn't work. Could you please tell me how can I query
the entire document instead of querying in one field?

In my schema I have *ap_** as a dynamic field.

Thanks,
Moiz
Reply | Threaded
Open this post in threaded view
|

Re: SOLR QUERY

kenf_nc
In your schema.xml there is a field called
<defaultSearchField>content</defaultSearchField> 
it may be something other than 'content'. This field is the one searched if you don't specify one in the query.

You can explicitly put something there with an <add> or you can have a <copyField> directive in your schema to move ap_* fields to the default search field.
Reply | Threaded
Open this post in threaded view
|

Re: SOLR QUERY

Jan Høydahl / Cominvent
Another way is to use DisMax parser, and give it a &qf=field1 field2 field3... parameter, and it will automatically search in all fields specified. It is more powerful than having one default field, and saves that disk space. Buy you sacrifice some extra resources during querying.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Training in Europe - www.solrtraining.com

On 6. aug. 2010, at 21.11, kenf_nc wrote:

>
> In your schema.xml there is a field called
> <defaultSearchField>content</defaultSearchField>
> it may be something other than 'content'. This field is the one searched if
> you don't specify one in the query.
>
> You can explicitly put something there with an <add> or you can have a
> <copyField> directive in your schema to move ap_* fields to the default
> search field.
> --
> View this message in context: http://lucene.472066.n3.nabble.com/SOLR-QUERY-tp1031554p1031567.html
> Sent from the Solr - User mailing list archive at Nabble.com.