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 Marcio Pinto Motta <ma...@gmail.com> on 2006/10/15 21:20:38 UTC
Solr Newbie question: doubts about how to search special fields.
Hi,
My "current" problem is to know how to make queries in special fields:
.Date Fields
.MultiValued Fields
Date Fields
I have in my schema some date fields like this
<field name="creation_date" type="date" indexed="true" stored="true"/>
And when I add content to this field I put in this mode:
<field name="creation_date">2006-08-11T00:00:00Z</field>
But when I try to serch
http://localhost:8080/solr/select/?stylesheet=&q=creation_date:2006-08-10T00:00:00Z&version=2.1&start=0&rows=10&indent=on
I get this error :
org.apache.solr.core.SolrException: Invalid Date String:'2006-08-10T00'
I think there is some special format to do queries like this :(
MultiValued Fields
My other problem is when I try to search in a multiValued Field.
I have in my schema this multiValued field
<field name="cod_profile" type="string" indexed="true" stored="true"
multiValued="true"/>
But when I try to search more than one value
http://localhost:8080/solr/select/?stylesheet=&q=cod_profile:84755+84756+84757&version=2.1&start=0&rows=10&indent=on
I get this result <result numFound="0" start="0"/>
I read the Solr Wiki, but I didn't find examples for these situations. Could
anyone please give me some "light" :)
Thanks for attention.
BR,
Marcio
Re: Solr Newbie question: doubts about how to search special fields.
Posted by Yonik Seeley <yo...@apache.org>.
The Solr query parser extends the Lucene query parser and makes very
few syntactic changes.
http://lucene.apache.org/java/docs/queryparsersyntax.html
On 10/15/06, Marcio Pinto Motta <ma...@gmail.com> wrote:
> creation_date:2006-08-10T00:00:00Z
':' is a special char to the lucene query parser. The easiest way to
solve this problem is to put the value in quotes:
q=creation_date:"2006-08-10T00:00:00Z"
>cod_profile:84755 84756 84757
For this one, I assume you want any of 84755 84756 84757 in the
cod_profile field.
What it is actually doing is searching for 84756 or 84757 in the
default search field in addition to 84755 in the cod_profile field.
What you want is
cod_profile:84755 cod_profile:84756 cod_profile:84757
or
cod_profile:(84755 84756 84757)
-Yonik