On 11/1/2010 11:14 PM, Ken Stanley wrote:
On Mon, Nov 1, 2010 at 10:26 PM, Tod<listac...@gmail.com> wrote:
I have a number of fields I need to do an exact match on. I've defined
them as 'string' in my schema.xml. I've noticed that I get back query
results that don't have all of the words I'm using to search with.
For example:
q=(((mykeywords:Compliance+With+Conduct+Standards)OR(mykeywords:All)OR(mykeywords:ALL)))&start=0&indent=true&wt=json
Should, with an exact match, return only one entry but it returns five some
of which don't have any of the fields I've specified. I've tried this both
with and without quotes.
What could I be doing wrong?
Thanks - Tod
Tod,
Without knowing your exact field definition, my first guess would be your
first boolean query; because it is not quoted, what SOLR typically does is
to transform that type of query into something like (assuming your uniqueKey
is "id"): (mykeywords:Compliance id:With id:Conduct id:Standards). If you do
(mykeywords:"Compliance+With+Conduct+Standards) you might see different
(better?) results. Otherwise, append&debugQuery=on to your URL and you can
see exactly how SOLR is parsing your query. If none of that helps, what is
your field definition in your schema.xml?
- Ken
The field definition is:
<field name="mykeywords" type="string" indexed="true" stored="true"
multiValued="true"/>
The request:
select?q=(((mykeywords:"Compliance+With+Attorney+Conduct+Standards")OR(mykeywords:All)OR(mykeywords:ALL)))&fl=mykeywords&start=0&indent=true&wt=json&debugQuery=on"
The response looks like this:
"responseHeader":{
"status":0,
"QTime":8,
"params":{
"wt":"json",
"q":"(((mykeywords:Compliance With Attorney Conduct
Standards)OR(mykeywords:All)OR(mykeywords:ALL)))",
"start":"0",
"indent":"true",
"fl":"mykeywords",
"debugQuery":"on"}},
"response":{"numFound":6,"start":0,"docs":[
{
"mykeywords":["Compliance With Attorney Conduct Standards"]},
{
"mykeywords":["Anti-Bribery","Bribes"]},
{
"mykeywords":["Marketing Guidelines","Marketing"]},
{},
{
"mykeywords":["Anti-Bribery","Due Diligence"]},
{
"mykeywords":["Anti-Bribery","AntiBribery"]}]
},
"debug":{
"rawquerystring":"(((mykeywords:Compliance With Attorney Conduct
Standards)OR(mykeywords:All)OR(mykeywords:ALL)))",
"querystring":"(((mykeywords:Compliance With Attorney Conduct
Standards)OR(mykeywords:All)OR(mykeywords:ALL)))",
"parsedquery":"(mykeywords:Compliance text:attorney text:conduct
text:standard) mykeywords:All mykeywords:ALL",
"parsedquery_toString":"(mykeywords:Compliance text:attorney
text:conduct text:standard) mykeywords:All mykeywords:ALL",
"explain":{
...
As you mentioned, looking at the parsed query its breaking the request
up on word boundaries rather than on the entire phrase. The goal is to
return only the very first entry. Any ideas?
Thanks - Tod