Quantcast

Solr - Unique Key Field Should Apply on q search or fq search

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Solr - Unique Key Field Should Apply on q search or fq search

meghana
I am right now applying unique key field search on q search. but sometimes it occurs issue with text search ,

For. e. g. if i search with below url, then it return results me as 0 rows , where as such record exist.

http://localhost:8080/solr/core0/select?q=myTextFeild:politics programme AND myuniquekey:193834

but if i modify my search with any of below mentioned search query it works properly.

http://localhost:8080/solr/core0/select?q=myuniquekey:193834 AND myTextFeild:politics programme

OR

http://localhost:8080/solr/core0/select?q=myTextFeild:politics programme&fq=myuniquekey:193834

Now i don't know which would be better option to apply , should i apply unique key on query or in filter query

Please Suggest.
Thanks


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Solr - Unique Key Field Should Apply on q search or fq search

iorixxx
> For. e. g. if i search with below url, then it return
> results me as 0 rows ,
> where as such record exist.
>
> http://localhost:8080/solr/core0/select?q=myTextFeild:politics
> programme AND
> myuniquekey:193834
>
> but if i modify my search with any of below mentioned search
> query it works
> properly.
>
> http://localhost:8080/solr/core0/select?q=myuniquekey:193834
> AND
> myTextFeild:politics programme
>
> OR
>
> http://localhost:8080/solr/core0/select?q=myTextFeild:politics
> programme&fq=myuniquekey:193834
>
> Now i don't know which would be better option to apply ,
> should i apply
> unique key on query or in filter query


myTextFeild:politics programme is parsed as follows :

myTextFeild:politics defaultField:programme

You should use parenthesis :
q=myTextFeild:(politics programme) AND myuniquekey:193834

Filter queries are cached, if you will be re-using same uniqueKey it is better to use fq.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Solr - Unique Key Field Should Apply on q search or fq search

meghana
Thanks iorixxx for help :)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Solr - Unique Key Field Should Apply on q search or fq search

Jack Krupansky-2
In reply to this post by meghana
A query such as "q=myTextFeild:politics programme" will search for
"programme" in the default search field, which may not have any hits. An
explicit field name applies to only the immediately successive term or
parenthesized sub-query.

The second and third queries work because the default operator is "OR", so
it doesn't matter that "programme" can't be found.

Maybe you meant "q=myTextFeild:(politics programme)"

Or, actually, "q=myTextFeild:(politics AND programme)" or
"q=myTextFeild:(+politics +programme)"

-- Jack Krupansky

-----Original Message-----
From: meghana
Sent: Friday, August 24, 2012 7:54 AM
To: [hidden email]
Subject: Solr - Unique Key Field Should Apply on q search or fq search

I am right now applying unique key field search on q search. but sometimes
it
occurs issue with text search ,

For. e. g. if i search with below url, then it return results me as 0 rows ,
where as such record exist.

http://localhost:8080/solr/core0/select?q=myTextFeild:politics programme AND
myuniquekey:193834

but if i modify my search with any of below mentioned search query it works
properly.

http://localhost:8080/solr/core0/select?q=myuniquekey:193834 AND
myTextFeild:politics programme

OR

http://localhost:8080/solr/core0/select?q=myTextFeild:politics
programme&fq=myuniquekey:193834

Now i don't know which would be better option to apply , should i apply
unique key on query or in filter query

Please Suggest.
Thanks






--
View this message in context:
http://lucene.472066.n3.nabble.com/Solr-Unique-Key-Field-Should-Apply-on-q-search-or-fq-search-tp4003066.html
Sent from the Solr - User mailing list archive at Nabble.com.

Loading...