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 leevduhl <ld...@corp.realcomp.com> on 2014/02/12 16:27:55 UTC
Newb - Search not returning any results
I setup a Solr Core and populated it with documents but I am not able to get
any results when attempting to search the documents.
A generic search (q=*.*) returns all documents (and fields/values within
those documents), however when I try to search using specific criteria I get
no results back.
I have the following setup in my Schema.xml:
<field name="id" type="string" indexed="true" stored="true" required="true"
multiValued="false" />
<field name="mailingcity" type="string" indexed="true" stored="true"
multiValued="false"/>
I run the following query against my Solr instance:
http://{domain}8983/solr/MIM/select?q=*&rows=2&fl=id+mailingcity&wt=json&indent=true&debugQuery=true
I get the following results back:
{
"responseHeader":{
"status":0,
"QTime":0,
"params":{
"debugQuery":"true",
"fl":"id, mailingcity",
"indent":"true",
"q":"*",
"wt":"json",
"rows":"2"}},
"response":{"numFound":18024,"start":0,"docs":[
{
"id":"214530123",
"mailingcity":"redford"},
{
"id":"204686608",
"mailingcity":"detroit"}]
},
"debug":{
"rawquerystring":"*",
"querystring":"*",
"parsedquery":"MatchAllDocsQuery(*:*)",
"parsedquery_toString":"*:*",
"explain":{
"214530123":"\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n 1.0 =
queryNorm\n",
"204686608":"\n1.0 = (MATCH) MatchAllDocsQuery, product of:\n 1.0 =
queryNorm\n"},
"QParser":"LuceneQParser",
...
}
However, when I try to search specifically where "mailingcity=redford" I
don't get any results back. See the following query/results.
Query:
http://{domain}:8983/solr/MIM/select?q=mailingcity=redford&rows=2&fl=id,mailingcity&wt=json&indent=true&debugQuery=true
Results:
{
"responseHeader": {
"status": 0,
"QTime": 1,
"params": {
"debugQuery": "true",
"fl": "id,mailingcity",
"indent": "true",
"q": "mailingcity=redford",
"_": "1392218691700",
"wt": "json",
"rows": "2"
}
},
"response": {
"numFound": 0,
"start": 0,
"docs": []
},
"debug": {
"rawquerystring": "mailingcity=redford",
"querystring": "mailingcity=redford",
"parsedquery": "text:mailingcity text:redford",
"parsedquery_toString": "text:mailingcity text:redford",
"explain": {},
"QParser": "LuceneQParser",
...
}
If anyone can provide some info on why this is happening and how to solve it
it would be appreciated.
Thank You
Lee
--
View this message in context: http://lucene.472066.n3.nabble.com/Newb-Search-not-returning-any-results-tp4116905.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Newb - Search not returning any results
Posted by leevduhl <ld...@corp.realcomp.com>.
Thanks the syntax correction solved the problem. I actually thought I tried
that before I posted.
Thanks
Lee
--
View this message in context: http://lucene.472066.n3.nabble.com/Newb-Search-not-returning-any-results-tp4116905p4116930.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Newb - Search not returning any results
Posted by Gora Mohanty <go...@mimirtech.com>.
On 12 February 2014 20:57, leevduhl <ld...@corp.realcomp.com> wrote:
[...]
> However, when I try to search specifically where "mailingcity=redford" I
> don't get any results back. See the following query/results.
>
> Query:
> http://{domain}:8983/solr/MIM/select?q=mailingcity=redford&rows=2&fl=id,mailingcity&wt=json&indent=true&debugQuery=true
Please start by reading https://wiki.apache.org/solr/SolrQuerySyntax
The argument to 'q' above should be mailingcity:redford. The debug
section in the results even tells you that, as the parsedquery becomes
"text:mailingcity text:redford" which means that it is searching the
default full-text search field for the strings "mailingcity" and/or "redford".
Regards,
Gora