Problem with Filter Query
Hi, I am using Solr 3.1 with SolrJ. I have a field called supplierName in my index which i am trying to do filtering on. When i select about 5 suppliers to filter on at the same time and use their supplier name to contruct a filter query i do not get any results but when i filter which each individual supplier name i get the required results. Here is the line code to that i used to contruct the filter query: *solrQuery.setParam(fq, arrayOfSupplierNames); *The supplier name field is stored as a string in the index and here is the config for the string type from my schema.xml file: !-- The StrField type is not analyzed, but indexed/stored verbatim. -- fieldType name=string class=solr.StrField sortMissingLast=true omitNorms=true/ Any help why this is happening will be much appreciated. Thanks.
Re: Problem with Filter Query
Hi, have you tried with: solrQuery.addFilterQuery(arrayOfSupplierNames) ? other question, is every element of your array composed in this way: supplierName:FIRST supplierName:SECOND etc.. HTH edo On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue kissue...@gmail.com wrote: Hi, I am using Solr 3.1 with SolrJ. I have a field called supplierName in my index which i am trying to do filtering on. When i select about 5 suppliers to filter on at the same time and use their supplier name to contruct a filter query i do not get any results but when i filter which each individual supplier name i get the required results. Here is the line code to that i used to contruct the filter query: *solrQuery.setParam(fq, arrayOfSupplierNames); *The supplier name field is stored as a string in the index and here is the config for the string type from my schema.xml file: !-- The StrField type is not analyzed, but indexed/stored verbatim. -- fieldType name=string class=solr.StrField sortMissingLast=true omitNorms=true/ Any help why this is happening will be much appreciated. Thanks. -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com
Re: Problem with Filter Query
Thanks for your response. Actually the elements are composed as follows: fq=firstfq=second But using Solr admin query screen i have modified the query to: fq=supplierName:firstfq=supplierName:second i still get the same results. I will try to use solrQuery.addFilterQuery(arrayOfSupplierNames) like you suggested and see how it goes. Thanks. On Thu, Jul 14, 2011 at 2:49 PM, Edoardo Tosca e.to...@sourcesense.comwrote: Hi, have you tried with: solrQuery.addFilterQuery(arrayOfSupplierNames) ? other question, is every element of your array composed in this way: supplierName:FIRST supplierName:SECOND etc.. HTH edo On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue kissue...@gmail.com wrote: Hi, I am using Solr 3.1 with SolrJ. I have a field called supplierName in my index which i am trying to do filtering on. When i select about 5 suppliers to filter on at the same time and use their supplier name to contruct a filter query i do not get any results but when i filter which each individual supplier name i get the required results. Here is the line code to that i used to contruct the filter query: *solrQuery.setParam(fq, arrayOfSupplierNames); *The supplier name field is stored as a string in the index and here is the config for the string type from my schema.xml file: !-- The StrField type is not analyzed, but indexed/stored verbatim. -- fieldType name=string class=solr.StrField sortMissingLast=true omitNorms=true/ Any help why this is happening will be much appreciated. Thanks. -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com
Re: Problem with Filter Query
So with fq=supplierName:firstfq=supplierName:second you don't get any results? is this field a multivalue? Mutliple FQs are evaluated as AND so your document must have in supplierName both first and second Edo On Thu, Jul 14, 2011 at 3:00 PM, Kissue Kissue kissue...@gmail.com wrote: Thanks for your response. Actually the elements are composed as follows: fq=firstfq=second But using Solr admin query screen i have modified the query to: fq=supplierName:firstfq=supplierName:second i still get the same results. I will try to use solrQuery.addFilterQuery(arrayOfSupplierNames) like you suggested and see how it goes. Thanks. On Thu, Jul 14, 2011 at 2:49 PM, Edoardo Tosca e.to...@sourcesense.com wrote: Hi, have you tried with: solrQuery.addFilterQuery(arrayOfSupplierNames) ? other question, is every element of your array composed in this way: supplierName:FIRST supplierName:SECOND etc.. HTH edo On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue kissue...@gmail.com wrote: Hi, I am using Solr 3.1 with SolrJ. I have a field called supplierName in my index which i am trying to do filtering on. When i select about 5 suppliers to filter on at the same time and use their supplier name to contruct a filter query i do not get any results but when i filter which each individual supplier name i get the required results. Here is the line code to that i used to contruct the filter query: *solrQuery.setParam(fq, arrayOfSupplierNames); *The supplier name field is stored as a string in the index and here is the config for the string type from my schema.xml file: !-- The StrField type is not analyzed, but indexed/stored verbatim. -- fieldType name=string class=solr.StrField sortMissingLast=true omitNorms=true/ Any help why this is happening will be much appreciated. Thanks. -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com
Re: Problem with Filter Query
No its not a multivalue field. Yes i can see that it looks like its doing an AND on all the filter values but how can i get it to do an OR? I just want it to return documents that have any of the supplied values as their supplier name. I have also tried: solrQuery.addFilterQuery(arrayOfSupplierNames) and i get no results too. Thanks. On Thu, Jul 14, 2011 at 3:06 PM, Edoardo Tosca e.to...@sourcesense.comwrote: So with fq=supplierName:firstfq=supplierName:second you don't get any results? is this field a multivalue? Mutliple FQs are evaluated as AND so your document must have in supplierName both first and second Edo On Thu, Jul 14, 2011 at 3:00 PM, Kissue Kissue kissue...@gmail.com wrote: Thanks for your response. Actually the elements are composed as follows: fq=firstfq=second But using Solr admin query screen i have modified the query to: fq=supplierName:firstfq=supplierName:second i still get the same results. I will try to use solrQuery.addFilterQuery(arrayOfSupplierNames) like you suggested and see how it goes. Thanks. On Thu, Jul 14, 2011 at 2:49 PM, Edoardo Tosca e.to...@sourcesense.com wrote: Hi, have you tried with: solrQuery.addFilterQuery(arrayOfSupplierNames) ? other question, is every element of your array composed in this way: supplierName:FIRST supplierName:SECOND etc.. HTH edo On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue kissue...@gmail.com wrote: Hi, I am using Solr 3.1 with SolrJ. I have a field called supplierName in my index which i am trying to do filtering on. When i select about 5 suppliers to filter on at the same time and use their supplier name to contruct a filter query i do not get any results but when i filter which each individual supplier name i get the required results. Here is the line code to that i used to contruct the filter query: *solrQuery.setParam(fq, arrayOfSupplierNames); *The supplier name field is stored as a string in the index and here is the config for the string type from my schema.xml file: !-- The StrField type is not analyzed, but indexed/stored verbatim. -- fieldType name=string class=solr.StrField sortMissingLast=true omitNorms=true/ Any help why this is happening will be much appreciated. Thanks. -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com
Re: Problem with Filter Query
As far as i know if you add multiple FQs they will be joined always with AND. You can do something like fq={!q.op=OR df=supplierName}first second third ... HTH Edo On Thu, Jul 14, 2011 at 3:50 PM, Kissue Kissue kissue...@gmail.com wrote: No its not a multivalue field. Yes i can see that it looks like its doing an AND on all the filter values but how can i get it to do an OR? I just want it to return documents that have any of the supplied values as their supplier name. I have also tried: solrQuery.addFilterQuery(arrayOfSupplierNames) and i get no results too. Thanks. On Thu, Jul 14, 2011 at 3:06 PM, Edoardo Tosca e.to...@sourcesense.com wrote: So with fq=supplierName:firstfq=supplierName:second you don't get any results? is this field a multivalue? Mutliple FQs are evaluated as AND so your document must have in supplierName both first and second Edo On Thu, Jul 14, 2011 at 3:00 PM, Kissue Kissue kissue...@gmail.com wrote: Thanks for your response. Actually the elements are composed as follows: fq=firstfq=second But using Solr admin query screen i have modified the query to: fq=supplierName:firstfq=supplierName:second i still get the same results. I will try to use solrQuery.addFilterQuery(arrayOfSupplierNames) like you suggested and see how it goes. Thanks. On Thu, Jul 14, 2011 at 2:49 PM, Edoardo Tosca e.to...@sourcesense.com wrote: Hi, have you tried with: solrQuery.addFilterQuery(arrayOfSupplierNames) ? other question, is every element of your array composed in this way: supplierName:FIRST supplierName:SECOND etc.. HTH edo On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue kissue...@gmail.com wrote: Hi, I am using Solr 3.1 with SolrJ. I have a field called supplierName in my index which i am trying to do filtering on. When i select about 5 suppliers to filter on at the same time and use their supplier name to contruct a filter query i do not get any results but when i filter which each individual supplier name i get the required results. Here is the line code to that i used to contruct the filter query: *solrQuery.setParam(fq, arrayOfSupplierNames); *The supplier name field is stored as a string in the index and here is the config for the string type from my schema.xml file: !-- The StrField type is not analyzed, but indexed/stored verbatim. -- fieldType name=string class=solr.StrField sortMissingLast=true omitNorms=true/ Any help why this is happening will be much appreciated. Thanks. -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com
Re: Problem with Filter Query
I have tried this but not working too. Thanks for your help. On Thu, Jul 14, 2011 at 3:59 PM, Edoardo Tosca e.to...@sourcesense.comwrote: As far as i know if you add multiple FQs they will be joined always with AND. You can do something like fq={!q.op=OR df=supplierName}first second third ... HTH Edo On Thu, Jul 14, 2011 at 3:50 PM, Kissue Kissue kissue...@gmail.com wrote: No its not a multivalue field. Yes i can see that it looks like its doing an AND on all the filter values but how can i get it to do an OR? I just want it to return documents that have any of the supplied values as their supplier name. I have also tried: solrQuery.addFilterQuery(arrayOfSupplierNames) and i get no results too. Thanks. On Thu, Jul 14, 2011 at 3:06 PM, Edoardo Tosca e.to...@sourcesense.com wrote: So with fq=supplierName:firstfq=supplierName:second you don't get any results? is this field a multivalue? Mutliple FQs are evaluated as AND so your document must have in supplierName both first and second Edo On Thu, Jul 14, 2011 at 3:00 PM, Kissue Kissue kissue...@gmail.com wrote: Thanks for your response. Actually the elements are composed as follows: fq=firstfq=second But using Solr admin query screen i have modified the query to: fq=supplierName:firstfq=supplierName:second i still get the same results. I will try to use solrQuery.addFilterQuery(arrayOfSupplierNames) like you suggested and see how it goes. Thanks. On Thu, Jul 14, 2011 at 2:49 PM, Edoardo Tosca e.to...@sourcesense.com wrote: Hi, have you tried with: solrQuery.addFilterQuery(arrayOfSupplierNames) ? other question, is every element of your array composed in this way: supplierName:FIRST supplierName:SECOND etc.. HTH edo On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue kissue...@gmail.com wrote: Hi, I am using Solr 3.1 with SolrJ. I have a field called supplierName in my index which i am trying to do filtering on. When i select about 5 suppliers to filter on at the same time and use their supplier name to contruct a filter query i do not get any results but when i filter which each individual supplier name i get the required results. Here is the line code to that i used to contruct the filter query: *solrQuery.setParam(fq, arrayOfSupplierNames); *The supplier name field is stored as a string in the index and here is the config for the string type from my schema.xml file: !-- The StrField type is not analyzed, but indexed/stored verbatim. -- fieldType name=string class=solr.StrField sortMissingLast=true omitNorms=true/ Any help why this is happening will be much appreciated. Thanks. -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com
Re: Problem with Filter Query
I have eventually gotten it to work with the following: fq=supplierName:first + supplierName:second + supplierName:third ... Thanks. On Thu, Jul 14, 2011 at 4:14 PM, Kissue Kissue kissue...@gmail.com wrote: I have tried this but not working too. Thanks for your help. On Thu, Jul 14, 2011 at 3:59 PM, Edoardo Tosca e.to...@sourcesense.comwrote: As far as i know if you add multiple FQs they will be joined always with AND. You can do something like fq={!q.op=OR df=supplierName}first second third ... HTH Edo On Thu, Jul 14, 2011 at 3:50 PM, Kissue Kissue kissue...@gmail.com wrote: No its not a multivalue field. Yes i can see that it looks like its doing an AND on all the filter values but how can i get it to do an OR? I just want it to return documents that have any of the supplied values as their supplier name. I have also tried: solrQuery.addFilterQuery(arrayOfSupplierNames) and i get no results too. Thanks. On Thu, Jul 14, 2011 at 3:06 PM, Edoardo Tosca e.to...@sourcesense.com wrote: So with fq=supplierName:firstfq=supplierName:second you don't get any results? is this field a multivalue? Mutliple FQs are evaluated as AND so your document must have in supplierName both first and second Edo On Thu, Jul 14, 2011 at 3:00 PM, Kissue Kissue kissue...@gmail.com wrote: Thanks for your response. Actually the elements are composed as follows: fq=firstfq=second But using Solr admin query screen i have modified the query to: fq=supplierName:firstfq=supplierName:second i still get the same results. I will try to use solrQuery.addFilterQuery(arrayOfSupplierNames) like you suggested and see how it goes. Thanks. On Thu, Jul 14, 2011 at 2:49 PM, Edoardo Tosca e.to...@sourcesense.com wrote: Hi, have you tried with: solrQuery.addFilterQuery(arrayOfSupplierNames) ? other question, is every element of your array composed in this way: supplierName:FIRST supplierName:SECOND etc.. HTH edo On Thu, Jul 14, 2011 at 2:18 PM, Kissue Kissue kissue...@gmail.com wrote: Hi, I am using Solr 3.1 with SolrJ. I have a field called supplierName in my index which i am trying to do filtering on. When i select about 5 suppliers to filter on at the same time and use their supplier name to contruct a filter query i do not get any results but when i filter which each individual supplier name i get the required results. Here is the line code to that i used to contruct the filter query: *solrQuery.setParam(fq, arrayOfSupplierNames); *The supplier name field is stored as a string in the index and here is the config for the string type from my schema.xml file: !-- The StrField type is not analyzed, but indexed/stored verbatim. -- fieldType name=string class=solr.StrField sortMissingLast=true omitNorms=true/ Any help why this is happening will be much appreciated. Thanks. -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com -- Edoardo Tosca Sourcesense - making sense of Open Source: http://www.sourcesense.com