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 dabboo <ag...@sapient.com> on 2009/03/20 08:44:29 UTC

Issue with Facet Query

Hi,

I am searching the indexes with facet query. Below is the query.

q=Answer&version=2.2&start=0&rows=10&indent=on&qt=dismaxrequest&facet=true&facet.field=productPrice_product_str_s:[0%20TO%2020]

It is giving me an exception saying:

str name="exception">org.apache.solr.common.SolrException: undefined field
productPrice_product_str_s:[0 TO 20] at
org.apache.solr.schema.IndexSchema.getField(IndexSchema.java:994) at
org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:152) at
org.apache.solr.request.SimpleFacets.getFacetFieldCounts(SimpleFacets.java:182)
at org.apache.solr.request.SimpleFacets.getFacetCounts(SimpleFacets.java:96)
at
org.apache.solr.handler.component.FacetComponent.process(FacetComponent.java:70)
at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:169)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
at org.apache.solr.core.SolrCore.execute

Can someone please guide me, how to prevent this exception. I guess, I am
missing some entries in some config file like solrConfig or schema. I would
appreciate if someone can tell me the specific entries, I need to make in
any config file.

Thanks a lot.

Thanks,
Amit Garg
-- 
View this message in context: http://www.nabble.com/Issue-with-Facet-Query-tp22615577p22615577.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Issue with Facet Query

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
And you'll need to re-index once you make the schema change.

On Fri, Mar 20, 2009 at 5:24 PM, Shalin Shekhar Mangar <
shalinmangar@gmail.com> wrote:

> What is the type of the productPrice_product_str field? I'm guessing that
> it is a string type.
>
> Since it is a float value and you need range search, you should change this
> to a 'sfloat' or 'sdouble' in your schema.xml
>
>
> On Fri, Mar 20, 2009 at 5:11 PM, dabboo <ag...@sapient.com> wrote:
>
>>
>> I am using this query only but I am getting the same results.
>>
>>
>>
>> facet=true&facet.field=productPrice_product_str_s&fq=productPrice_product_str_s:[1%20TO%20100]
>>
>>
>> - <lst name="facet_fields">
>> - <lst name="productPrice_product_str_s">
>>   <int name="100">202</int>
>>  <int name="10">57</int>
>>  <int name="10.6">14</int>
>>  <int name="10.2">11</int>
>>  <int name="10.67">10</int>
>>  <int name="10.8">9</int>
>>  <int name="10.99">9</int>
>>  <int name="1.33">7</int>
>>  <int name="1">6</int>
>>  <int name="10.4">5</int>
>>  <int name="10.34">4</int>
>>  <int name="1.01">2</int>
>>  <int name="1.2">2</int>
>>  <int name="1.66">2</int>
>>  <int name="10.63">2</int>
>>  <int name="10.66">2</int>
>>  <int name="1.4">1</int>
>>  <int name="1.7">1</int>
>>  <int name="1.8">1</int>
>>  <int name="10.33">1</int>
>>  <int name="10.75">1</int>
>>  <int name="10.9">1</int>
>>  <int name=".01">0</int>
>>  <int name=".2">0</int>
>>   <int name="0">0</int>
>>   <int name="100.05">0</int>
>>  <int name="100.07">0</int>
>>  <int name="100.13">0</int>
>>  <int name="100.2">0</int>
>>  <int name="100.25">0</int>
>>  <int name="100.33">0</int>
>>  <int name="100.4">0</int>
>>  <int name="100.45">0</int>
>>  <int name="100.53">0</int>
>>  <int name="100.6">0</int>
>>  <int name="100.67">0</int>
>>  <int name="100.73">0</int>
>>  <int name="100.8">0</int>
>>  <int name="100.87">0</int>
>>  <int name="100.95">0</int>
>>  <int name="100.96">0</int>
>>  <int name="101">0</int>
>>  <int name="101.1">0</int>
>>  <int name="101.13">0</int>
>>  <int name="101.2">0</int>
>>  <int name="101.27">0</int>
>>  <int name="101.33">0</int>
>>  <int name="101.4">0</int>
>>  <int name="101.47">0</int>
>>  <int name="101.6">0</int>
>>  <int name="101.67">0</int>
>>  <int name="101.73">0</int>
>>  <int name="101.8">0</int>
>>  <int name="101.87">0</int>
>>
>> It still is not showing up the other values. Do I need to make any entry
>> in
>> schema or solrConfig xml files. Do I need to convert the string into
>> numeric
>> values etc etc.
>>
>> Please suggest.
>>
>> Thanks,
>> Amit
>>
>>
>> Shalin Shekhar Mangar wrote:
>> >
>> > On Fri, Mar 20, 2009 at 4:00 PM, dabboo <ag...@sapient.com> wrote:
>> >
>> >>
>> >> Hi Shalin,
>> >>
>> >> One more thing,
>> >>
>> >>
>> >>
>> facet.field=productPrice_product_str_s&facet.query=productPrice_product_str_s:[0%20TO%20100]
>> >>
>> >> This is my query and these are results, I am getting:
>> >>
>> >> <int name="100">202</int>
>> >>  <int name="10">57</int>
>> >>  <int name="10.6">14</int>
>> >>  <int name="10.2">11</int>
>> >>  <int name="10.67">10</int>
>> >>  <int name="10.8">9</int>
>> >>  <int name="10.99">9</int>
>> >>  <int name="1.33">7</int>
>> >>  <int name="1">6</int>
>> >>  <int name="10.4">5</int>
>> >>  <int name="10.34">4</int>
>> >>  <int name="1.01">2</int>
>> >>  <int name="1.2">2</int>
>> >>  <int name="1.66">2</int>
>> >>  <int name="10.63">2</int>
>> >>  <int name="10.66">2</int>
>> >>  <int name="1.4">1</int>
>> >>  <int name="1.7">1</int>
>> >>  <int name="1.8">1</int>
>> >>  <int name="10.33">1</int>
>> >>  <int name="10.75">1</int>
>> >>  <int name="10.9">1</int>
>> >>  <int name=".01">0</int>
>> >>  <int name=".2">0</int>
>> >>  <int name="100.05">0</int>
>> >>  <int name="100.07">0</int>
>> >>  <int name="100.13">0</int>
>> >>  <int name="100.2">0</int>
>> >>  <int name="100.25">0</int>
>> >>  <int name="100.33">0</int>
>> >>  <int name="100.4">0</int>
>> >>  <int name="100.45">0</int>
>> >>  <int name="100.53">0</int>
>> >>  <int name="100.6">0</int>
>> >>  <int name="100.67">0</int>
>> >>  <int name="100.73">0</int>
>> >>  <int name="100.8">0</int>
>> >>  <int name="100.87">0</int>
>> >>  <int name="100.95">0</int>
>> >>  <int name="100.96">0</int>
>> >>  <int name="101">0</int>
>> >>  <int name="101.1">0</int>
>> >>  <int name="101.13">0</int>
>> >>  <int name="101.2">0</int>
>> >>  <int name="101.27">0</int>
>> >>  <int name="101.33">0</int>
>> >>  <int name="101.4">0</int>
>> >>  <int name="101.47">0</int>
>> >>  <int name="101.6">0</int>
>> >>  <int name="101.67">0</int>
>> >>  <int name="101.73">0</int>
>> >>  <int name="101.8">0</int>
>> >>  <int name="101.87">0</int>
>> >>  <int name="102">0</int>
>> >>  <int name="102.07">0</int>
>> >>  <int name="102.19">0</int>
>> >>  <int name="102.2">0</int>
>> >>  <int name="102.27">0</int>
>> >>  <int name="102.33">0</int>
>> >>  <int name="102.4">0</int>
>> >>  <int name="102.53">0</int>
>> >>  <int name="102.6">0</int>
>> >>  <int name="102.67">0</int>
>> >>  <int name="102.8">0</int>
>> >>  <int name="102.87">0</int>
>> >>  <int name="102.93">0</int>
>> >>  <int name="1022.4">0</int>
>> >>  <int name="103">0</int>
>> >>
>> >> It is only returning results, which are having values started with 2,
>> 3,
>> >> 4
>> >> or some other integer instead of only 1. It is not returning records in
>> >> which value is >10 and <100.
>> >>
>> >
>> > Please do not send a duplicate mails. It will not help you get an answer
>> > faster.
>> >
>> > If you need to filter results to a specific range then you should use
>> > filter
>> > queries through the fq parameter:
>> >
>> > fq=productPrice_product_str_s:[0%20TO%20100]
>> >
>> > --
>> > Regards,
>> > Shalin Shekhar Mangar.
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Issue-with-Facet-Query-tp22615577p22618714.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
>
>
> --
> Regards,
> Shalin Shekhar Mangar.
>



-- 
Regards,
Shalin Shekhar Mangar.

Re: Issue with Facet Query

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
What is the type of the productPrice_product_str field? I'm guessing that it
is a string type.

Since it is a float value and you need range search, you should change this
to a 'sfloat' or 'sdouble' in your schema.xml

On Fri, Mar 20, 2009 at 5:11 PM, dabboo <ag...@sapient.com> wrote:

>
> I am using this query only but I am getting the same results.
>
>
>
> facet=true&facet.field=productPrice_product_str_s&fq=productPrice_product_str_s:[1%20TO%20100]
>
>
> - <lst name="facet_fields">
> - <lst name="productPrice_product_str_s">
>   <int name="100">202</int>
>  <int name="10">57</int>
>  <int name="10.6">14</int>
>  <int name="10.2">11</int>
>  <int name="10.67">10</int>
>  <int name="10.8">9</int>
>  <int name="10.99">9</int>
>  <int name="1.33">7</int>
>  <int name="1">6</int>
>  <int name="10.4">5</int>
>  <int name="10.34">4</int>
>  <int name="1.01">2</int>
>  <int name="1.2">2</int>
>  <int name="1.66">2</int>
>  <int name="10.63">2</int>
>  <int name="10.66">2</int>
>  <int name="1.4">1</int>
>  <int name="1.7">1</int>
>  <int name="1.8">1</int>
>  <int name="10.33">1</int>
>  <int name="10.75">1</int>
>  <int name="10.9">1</int>
>  <int name=".01">0</int>
>  <int name=".2">0</int>
>   <int name="0">0</int>
>   <int name="100.05">0</int>
>  <int name="100.07">0</int>
>  <int name="100.13">0</int>
>  <int name="100.2">0</int>
>  <int name="100.25">0</int>
>  <int name="100.33">0</int>
>  <int name="100.4">0</int>
>  <int name="100.45">0</int>
>  <int name="100.53">0</int>
>  <int name="100.6">0</int>
>  <int name="100.67">0</int>
>  <int name="100.73">0</int>
>  <int name="100.8">0</int>
>  <int name="100.87">0</int>
>  <int name="100.95">0</int>
>  <int name="100.96">0</int>
>  <int name="101">0</int>
>  <int name="101.1">0</int>
>  <int name="101.13">0</int>
>  <int name="101.2">0</int>
>  <int name="101.27">0</int>
>  <int name="101.33">0</int>
>  <int name="101.4">0</int>
>  <int name="101.47">0</int>
>  <int name="101.6">0</int>
>  <int name="101.67">0</int>
>  <int name="101.73">0</int>
>  <int name="101.8">0</int>
>  <int name="101.87">0</int>
>
> It still is not showing up the other values. Do I need to make any entry in
> schema or solrConfig xml files. Do I need to convert the string into
> numeric
> values etc etc.
>
> Please suggest.
>
> Thanks,
> Amit
>
>
> Shalin Shekhar Mangar wrote:
> >
> > On Fri, Mar 20, 2009 at 4:00 PM, dabboo <ag...@sapient.com> wrote:
> >
> >>
> >> Hi Shalin,
> >>
> >> One more thing,
> >>
> >>
> >>
> facet.field=productPrice_product_str_s&facet.query=productPrice_product_str_s:[0%20TO%20100]
> >>
> >> This is my query and these are results, I am getting:
> >>
> >> <int name="100">202</int>
> >>  <int name="10">57</int>
> >>  <int name="10.6">14</int>
> >>  <int name="10.2">11</int>
> >>  <int name="10.67">10</int>
> >>  <int name="10.8">9</int>
> >>  <int name="10.99">9</int>
> >>  <int name="1.33">7</int>
> >>  <int name="1">6</int>
> >>  <int name="10.4">5</int>
> >>  <int name="10.34">4</int>
> >>  <int name="1.01">2</int>
> >>  <int name="1.2">2</int>
> >>  <int name="1.66">2</int>
> >>  <int name="10.63">2</int>
> >>  <int name="10.66">2</int>
> >>  <int name="1.4">1</int>
> >>  <int name="1.7">1</int>
> >>  <int name="1.8">1</int>
> >>  <int name="10.33">1</int>
> >>  <int name="10.75">1</int>
> >>  <int name="10.9">1</int>
> >>  <int name=".01">0</int>
> >>  <int name=".2">0</int>
> >>  <int name="100.05">0</int>
> >>  <int name="100.07">0</int>
> >>  <int name="100.13">0</int>
> >>  <int name="100.2">0</int>
> >>  <int name="100.25">0</int>
> >>  <int name="100.33">0</int>
> >>  <int name="100.4">0</int>
> >>  <int name="100.45">0</int>
> >>  <int name="100.53">0</int>
> >>  <int name="100.6">0</int>
> >>  <int name="100.67">0</int>
> >>  <int name="100.73">0</int>
> >>  <int name="100.8">0</int>
> >>  <int name="100.87">0</int>
> >>  <int name="100.95">0</int>
> >>  <int name="100.96">0</int>
> >>  <int name="101">0</int>
> >>  <int name="101.1">0</int>
> >>  <int name="101.13">0</int>
> >>  <int name="101.2">0</int>
> >>  <int name="101.27">0</int>
> >>  <int name="101.33">0</int>
> >>  <int name="101.4">0</int>
> >>  <int name="101.47">0</int>
> >>  <int name="101.6">0</int>
> >>  <int name="101.67">0</int>
> >>  <int name="101.73">0</int>
> >>  <int name="101.8">0</int>
> >>  <int name="101.87">0</int>
> >>  <int name="102">0</int>
> >>  <int name="102.07">0</int>
> >>  <int name="102.19">0</int>
> >>  <int name="102.2">0</int>
> >>  <int name="102.27">0</int>
> >>  <int name="102.33">0</int>
> >>  <int name="102.4">0</int>
> >>  <int name="102.53">0</int>
> >>  <int name="102.6">0</int>
> >>  <int name="102.67">0</int>
> >>  <int name="102.8">0</int>
> >>  <int name="102.87">0</int>
> >>  <int name="102.93">0</int>
> >>  <int name="1022.4">0</int>
> >>  <int name="103">0</int>
> >>
> >> It is only returning results, which are having values started with 2, 3,
> >> 4
> >> or some other integer instead of only 1. It is not returning records in
> >> which value is >10 and <100.
> >>
> >
> > Please do not send a duplicate mails. It will not help you get an answer
> > faster.
> >
> > If you need to filter results to a specific range then you should use
> > filter
> > queries through the fq parameter:
> >
> > fq=productPrice_product_str_s:[0%20TO%20100]
> >
> > --
> > Regards,
> > Shalin Shekhar Mangar.
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Issue-with-Facet-Query-tp22615577p22618714.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


-- 
Regards,
Shalin Shekhar Mangar.

Re: Issue with Facet Query

Posted by Chris Hostetter <ho...@fucit.org>.
: I am using this query only but I am getting the same results. 
: 
: 
: facet=true&facet.field=productPrice_product_str_s&fq=productPrice_product_str_s:[1%20TO%20100]
	...
: It still is not showing up the other values. Do I need to make any entry in
: schema or solrConfig xml files. Do I need to convert the string into numeric
: values etc etc.
	...
: >> It is only returning results, which are having values started with 2, 3,
: >> 4
: >> or some other integer instead of only 1. It is not returning records in
: >> which value is >10 and <100.

your "fq" param is saying you only want docs matching values between 1 and 
100, you seem to be using a string type, so it's not going to match 
anything starting with a character other then a "1" ... if it doens't 
match any docs with values like "23" then the facet counts for "23" are 
going to be 0 as well.

reading between the lines, i think you missunderstood Shalin about 10 
messages ago ... "fq" is for providing a *filter* query, it restricts the 
results of your entire query.  facet.query is for faceting on an arbitrary 
query (which can be a range query)

if you search for 'ipod' and you want to get back *all* the
documents that match, but you also want to know how many of those have a 
price between $10 and $100 use a facet.query.

if you search for 'ipod' and you want to get back *only* the documents
that have a price between $10 and $100 use an fq.

...but either way: yes, convert to a numeric field type so that your 
ranges will actually work properly.



-Hoss


Re: Issue with Facet Query

Posted by dabboo <ag...@sapient.com>.
I am using this query only but I am getting the same results. 


facet=true&facet.field=productPrice_product_str_s&fq=productPrice_product_str_s:[1%20TO%20100]


- <lst name="facet_fields">
- <lst name="productPrice_product_str_s">
  <int name="100">202</int> 
  <int name="10">57</int> 
  <int name="10.6">14</int> 
  <int name="10.2">11</int> 
  <int name="10.67">10</int> 
  <int name="10.8">9</int> 
  <int name="10.99">9</int> 
  <int name="1.33">7</int> 
  <int name="1">6</int> 
  <int name="10.4">5</int> 
  <int name="10.34">4</int> 
  <int name="1.01">2</int> 
  <int name="1.2">2</int> 
  <int name="1.66">2</int> 
  <int name="10.63">2</int> 
  <int name="10.66">2</int> 
  <int name="1.4">1</int> 
  <int name="1.7">1</int> 
  <int name="1.8">1</int> 
  <int name="10.33">1</int> 
  <int name="10.75">1</int> 
  <int name="10.9">1</int> 
  <int name=".01">0</int> 
  <int name=".2">0</int> 
  <int name="0">0</int> 
  <int name="100.05">0</int> 
  <int name="100.07">0</int> 
  <int name="100.13">0</int> 
  <int name="100.2">0</int> 
  <int name="100.25">0</int> 
  <int name="100.33">0</int> 
  <int name="100.4">0</int> 
  <int name="100.45">0</int> 
  <int name="100.53">0</int> 
  <int name="100.6">0</int> 
  <int name="100.67">0</int> 
  <int name="100.73">0</int> 
  <int name="100.8">0</int> 
  <int name="100.87">0</int> 
  <int name="100.95">0</int> 
  <int name="100.96">0</int> 
  <int name="101">0</int> 
  <int name="101.1">0</int> 
  <int name="101.13">0</int> 
  <int name="101.2">0</int> 
  <int name="101.27">0</int> 
  <int name="101.33">0</int> 
  <int name="101.4">0</int> 
  <int name="101.47">0</int> 
  <int name="101.6">0</int> 
  <int name="101.67">0</int> 
  <int name="101.73">0</int> 
  <int name="101.8">0</int> 
  <int name="101.87">0</int> 

It still is not showing up the other values. Do I need to make any entry in
schema or solrConfig xml files. Do I need to convert the string into numeric
values etc etc.

Please suggest.

Thanks,
Amit


Shalin Shekhar Mangar wrote:
> 
> On Fri, Mar 20, 2009 at 4:00 PM, dabboo <ag...@sapient.com> wrote:
> 
>>
>> Hi Shalin,
>>
>> One more thing,
>>
>>
>> facet.field=productPrice_product_str_s&facet.query=productPrice_product_str_s:[0%20TO%20100]
>>
>> This is my query and these are results, I am getting:
>>
>> <int name="100">202</int>
>>  <int name="10">57</int>
>>  <int name="10.6">14</int>
>>  <int name="10.2">11</int>
>>  <int name="10.67">10</int>
>>  <int name="10.8">9</int>
>>  <int name="10.99">9</int>
>>  <int name="1.33">7</int>
>>  <int name="1">6</int>
>>  <int name="10.4">5</int>
>>  <int name="10.34">4</int>
>>  <int name="1.01">2</int>
>>  <int name="1.2">2</int>
>>  <int name="1.66">2</int>
>>  <int name="10.63">2</int>
>>  <int name="10.66">2</int>
>>  <int name="1.4">1</int>
>>  <int name="1.7">1</int>
>>  <int name="1.8">1</int>
>>  <int name="10.33">1</int>
>>  <int name="10.75">1</int>
>>  <int name="10.9">1</int>
>>  <int name=".01">0</int>
>>  <int name=".2">0</int>
>>  <int name="100.05">0</int>
>>  <int name="100.07">0</int>
>>  <int name="100.13">0</int>
>>  <int name="100.2">0</int>
>>  <int name="100.25">0</int>
>>  <int name="100.33">0</int>
>>  <int name="100.4">0</int>
>>  <int name="100.45">0</int>
>>  <int name="100.53">0</int>
>>  <int name="100.6">0</int>
>>  <int name="100.67">0</int>
>>  <int name="100.73">0</int>
>>  <int name="100.8">0</int>
>>  <int name="100.87">0</int>
>>  <int name="100.95">0</int>
>>  <int name="100.96">0</int>
>>  <int name="101">0</int>
>>  <int name="101.1">0</int>
>>  <int name="101.13">0</int>
>>  <int name="101.2">0</int>
>>  <int name="101.27">0</int>
>>  <int name="101.33">0</int>
>>  <int name="101.4">0</int>
>>  <int name="101.47">0</int>
>>  <int name="101.6">0</int>
>>  <int name="101.67">0</int>
>>  <int name="101.73">0</int>
>>  <int name="101.8">0</int>
>>  <int name="101.87">0</int>
>>  <int name="102">0</int>
>>  <int name="102.07">0</int>
>>  <int name="102.19">0</int>
>>  <int name="102.2">0</int>
>>  <int name="102.27">0</int>
>>  <int name="102.33">0</int>
>>  <int name="102.4">0</int>
>>  <int name="102.53">0</int>
>>  <int name="102.6">0</int>
>>  <int name="102.67">0</int>
>>  <int name="102.8">0</int>
>>  <int name="102.87">0</int>
>>  <int name="102.93">0</int>
>>  <int name="1022.4">0</int>
>>  <int name="103">0</int>
>>
>> It is only returning results, which are having values started with 2, 3,
>> 4
>> or some other integer instead of only 1. It is not returning records in
>> which value is >10 and <100.
>>
> 
> Please do not send a duplicate mails. It will not help you get an answer
> faster.
> 
> If you need to filter results to a specific range then you should use
> filter
> queries through the fq parameter:
> 
> fq=productPrice_product_str_s:[0%20TO%20100]
> 
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 
> 

-- 
View this message in context: http://www.nabble.com/Issue-with-Facet-Query-tp22615577p22618714.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Issue with Facet Query

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Mar 20, 2009 at 4:00 PM, dabboo <ag...@sapient.com> wrote:

>
> Hi Shalin,
>
> One more thing,
>
>
> facet.field=productPrice_product_str_s&facet.query=productPrice_product_str_s:[0%20TO%20100]
>
> This is my query and these are results, I am getting:
>
> <int name="100">202</int>
>  <int name="10">57</int>
>  <int name="10.6">14</int>
>  <int name="10.2">11</int>
>  <int name="10.67">10</int>
>  <int name="10.8">9</int>
>  <int name="10.99">9</int>
>  <int name="1.33">7</int>
>  <int name="1">6</int>
>  <int name="10.4">5</int>
>  <int name="10.34">4</int>
>  <int name="1.01">2</int>
>  <int name="1.2">2</int>
>  <int name="1.66">2</int>
>  <int name="10.63">2</int>
>  <int name="10.66">2</int>
>  <int name="1.4">1</int>
>  <int name="1.7">1</int>
>  <int name="1.8">1</int>
>  <int name="10.33">1</int>
>  <int name="10.75">1</int>
>  <int name="10.9">1</int>
>  <int name=".01">0</int>
>  <int name=".2">0</int>
>  <int name="100.05">0</int>
>  <int name="100.07">0</int>
>  <int name="100.13">0</int>
>  <int name="100.2">0</int>
>  <int name="100.25">0</int>
>  <int name="100.33">0</int>
>  <int name="100.4">0</int>
>  <int name="100.45">0</int>
>  <int name="100.53">0</int>
>  <int name="100.6">0</int>
>  <int name="100.67">0</int>
>  <int name="100.73">0</int>
>  <int name="100.8">0</int>
>  <int name="100.87">0</int>
>  <int name="100.95">0</int>
>  <int name="100.96">0</int>
>  <int name="101">0</int>
>  <int name="101.1">0</int>
>  <int name="101.13">0</int>
>  <int name="101.2">0</int>
>  <int name="101.27">0</int>
>  <int name="101.33">0</int>
>  <int name="101.4">0</int>
>  <int name="101.47">0</int>
>  <int name="101.6">0</int>
>  <int name="101.67">0</int>
>  <int name="101.73">0</int>
>  <int name="101.8">0</int>
>  <int name="101.87">0</int>
>  <int name="102">0</int>
>  <int name="102.07">0</int>
>  <int name="102.19">0</int>
>  <int name="102.2">0</int>
>  <int name="102.27">0</int>
>  <int name="102.33">0</int>
>  <int name="102.4">0</int>
>  <int name="102.53">0</int>
>  <int name="102.6">0</int>
>  <int name="102.67">0</int>
>  <int name="102.8">0</int>
>  <int name="102.87">0</int>
>  <int name="102.93">0</int>
>  <int name="1022.4">0</int>
>  <int name="103">0</int>
>
> It is only returning results, which are having values started with 2, 3, 4
> or some other integer instead of only 1. It is not returning records in
> which value is >10 and <100.
>

Please do not send a duplicate mails. It will not help you get an answer
faster.

If you need to filter results to a specific range then you should use filter
queries through the fq parameter:

fq=productPrice_product_str_s:[0%20TO%20100]

-- 
Regards,
Shalin Shekhar Mangar.

Re: Issue with Facet Query

Posted by dabboo <ag...@sapient.com>.
Hi Shalin,

One more thing, 

facet.field=productPrice_product_str_s&facet.query=productPrice_product_str_s:[0%20TO%20100]

This is my query and these are results, I am getting:

<int name="100">202</int> 
  <int name="10">57</int> 
  <int name="10.6">14</int> 
  <int name="10.2">11</int> 
  <int name="10.67">10</int> 
  <int name="10.8">9</int> 
  <int name="10.99">9</int> 
  <int name="1.33">7</int> 
  <int name="1">6</int> 
  <int name="10.4">5</int> 
  <int name="10.34">4</int> 
  <int name="1.01">2</int> 
  <int name="1.2">2</int> 
  <int name="1.66">2</int> 
  <int name="10.63">2</int> 
  <int name="10.66">2</int> 
  <int name="1.4">1</int> 
  <int name="1.7">1</int> 
  <int name="1.8">1</int> 
  <int name="10.33">1</int> 
  <int name="10.75">1</int> 
  <int name="10.9">1</int> 
  <int name=".01">0</int> 
  <int name=".2">0</int> 
  <int name="100.05">0</int> 
  <int name="100.07">0</int> 
  <int name="100.13">0</int> 
  <int name="100.2">0</int> 
  <int name="100.25">0</int> 
  <int name="100.33">0</int> 
  <int name="100.4">0</int> 
  <int name="100.45">0</int> 
  <int name="100.53">0</int> 
  <int name="100.6">0</int> 
  <int name="100.67">0</int> 
  <int name="100.73">0</int> 
  <int name="100.8">0</int> 
  <int name="100.87">0</int> 
  <int name="100.95">0</int> 
  <int name="100.96">0</int> 
  <int name="101">0</int> 
  <int name="101.1">0</int> 
  <int name="101.13">0</int> 
  <int name="101.2">0</int> 
  <int name="101.27">0</int> 
  <int name="101.33">0</int> 
  <int name="101.4">0</int> 
  <int name="101.47">0</int> 
  <int name="101.6">0</int> 
  <int name="101.67">0</int> 
  <int name="101.73">0</int> 
  <int name="101.8">0</int> 
  <int name="101.87">0</int> 
  <int name="102">0</int> 
  <int name="102.07">0</int> 
  <int name="102.19">0</int> 
  <int name="102.2">0</int> 
  <int name="102.27">0</int> 
  <int name="102.33">0</int> 
  <int name="102.4">0</int> 
  <int name="102.53">0</int> 
  <int name="102.6">0</int> 
  <int name="102.67">0</int> 
  <int name="102.8">0</int> 
  <int name="102.87">0</int> 
  <int name="102.93">0</int> 
  <int name="1022.4">0</int> 
  <int name="103">0</int> 

It is only returning results, which are having values started with 2, 3, 4
or some other integer instead of only 1. It is not returning records in
which value is >10 and <100.

Please suggest.

thanks,
Amit




dabboo wrote:
> 
> Thanks Shalin, thanks a lot. I appreciate your help in resolving this
> issue.
> 
> Thanks,
> Amit
> 
> Shalin Shekhar Mangar wrote:
>> 
>> On Fri, Mar 20, 2009 at 2:27 PM, dabboo <ag...@sapient.com> wrote:
>> 
>>>
>>> Shalin, thanks a lot. One quick question:
>>>
>>> Now, after putting the query in the way, you suggested, I am getting:
>>>
>>> - <lst name="facet_counts">
>>> - <lst name="facet_queries">
>>>  <int name="productPrice_product_s:[0 TO 20]">23315</int>
>>>  </lst>
>>>  <lst name="facet_fields" />
>>>  <lst name="facet_dates" />
>>>  </lst>
>>>
>>> But it is not returning me records. Do I need to enter this field entry
>>> in
>>> schema.xml to get the records or anywhere else.
>>>
>> 
>> facet.query returns the number of documents matching that query after
>> applying any filters (fq) that you may have specified.
>> 
>> Can you tell us your use-case?
>> 
>> -- 
>> Regards,
>> Shalin Shekhar Mangar.
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Issue-with-Facet-Query-tp22615577p22617745.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Issue with Facet Query

Posted by dabboo <ag...@sapient.com>.
Thanks Shalin, thanks a lot. I appreciate your help in resolving this issue.

Thanks,
Amit

Shalin Shekhar Mangar wrote:
> 
> On Fri, Mar 20, 2009 at 2:27 PM, dabboo <ag...@sapient.com> wrote:
> 
>>
>> Shalin, thanks a lot. One quick question:
>>
>> Now, after putting the query in the way, you suggested, I am getting:
>>
>> - <lst name="facet_counts">
>> - <lst name="facet_queries">
>>  <int name="productPrice_product_s:[0 TO 20]">23315</int>
>>  </lst>
>>  <lst name="facet_fields" />
>>  <lst name="facet_dates" />
>>  </lst>
>>
>> But it is not returning me records. Do I need to enter this field entry
>> in
>> schema.xml to get the records or anywhere else.
>>
> 
> facet.query returns the number of documents matching that query after
> applying any filters (fq) that you may have specified.
> 
> Can you tell us your use-case?
> 
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 
> 

-- 
View this message in context: http://www.nabble.com/Issue-with-Facet-Query-tp22615577p22616724.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Issue with Facet Query

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Mar 20, 2009 at 2:27 PM, dabboo <ag...@sapient.com> wrote:

>
> Shalin, thanks a lot. One quick question:
>
> Now, after putting the query in the way, you suggested, I am getting:
>
> - <lst name="facet_counts">
> - <lst name="facet_queries">
>  <int name="productPrice_product_s:[0 TO 20]">23315</int>
>  </lst>
>  <lst name="facet_fields" />
>  <lst name="facet_dates" />
>  </lst>
>
> But it is not returning me records. Do I need to enter this field entry in
> schema.xml to get the records or anywhere else.
>

facet.query returns the number of documents matching that query after
applying any filters (fq) that you may have specified.

Can you tell us your use-case?

-- 
Regards,
Shalin Shekhar Mangar.

Re: Issue with Facet Query

Posted by dabboo <ag...@sapient.com>.
Shalin, thanks a lot. One quick question:

Now, after putting the query in the way, you suggested, I am getting:

- <lst name="facet_counts">
- <lst name="facet_queries">
  <int name="productPrice_product_s:[0 TO 20]">23315</int> 
  </lst>
  <lst name="facet_fields" /> 
  <lst name="facet_dates" /> 
  </lst>

But it is not returning me records. Do I need to enter this field entry in
schema.xml to get the records or anywhere else.

Thanks,
Amit Garg


Shalin Shekhar Mangar wrote:
> 
> On Fri, Mar 20, 2009 at 1:49 PM, dabboo <ag...@sapient.com> wrote:
> 
>>
>> Thanks a lot for this information. But is there any way, I can impose the
>> range on the facet.
>> for e.g. If I want to search the data between a specific range, how
>> should
>> I
>> form my query.
>>
> 
> Use a filter query, fq=productPrice_product_str_s:[0 TO 20]
> 
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 
> 

-- 
View this message in context: http://www.nabble.com/Issue-with-Facet-Query-tp22615577p22616536.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Issue with Facet Query

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Mar 20, 2009 at 1:49 PM, dabboo <ag...@sapient.com> wrote:

>
> Thanks a lot for this information. But is there any way, I can impose the
> range on the facet.
> for e.g. If I want to search the data between a specific range, how should
> I
> form my query.
>

Use a filter query, fq=productPrice_product_str_s:[0 TO 20]

-- 
Regards,
Shalin Shekhar Mangar.

Re: Issue with Facet Query

Posted by dabboo <ag...@sapient.com>.
Thanks a lot for this information. But is there any way, I can impose the
range on the facet. 
for e.g. If I want to search the data between a specific range, how should I
form my query.

Do I need to make some entries some where.

Thanks,
Amit Garg



Shalin Shekhar Mangar wrote:
> 
> On Fri, Mar 20, 2009 at 1:14 PM, dabboo <ag...@sapient.com> wrote:
> 
>>
>> Hi,
>>
>> I am searching the indexes with facet query. Below is the query.
>>
>>
>> q=Answer&version=2.2&start=0&rows=10&indent=on&qt=dismaxrequest&facet=true&facet.field=productPrice_product_str_s:[0%20TO%2020]
>>
> 
> facet.field takes a field name. It does not accept queries. Use
> facet.query
> for getting count of a query. Use fq to restrict facets by a certain
> query.
> 
> See http://wiki.apache.org/solr/SimpleFacetParameters
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 
> 

-- 
View this message in context: http://www.nabble.com/Issue-with-Facet-Query-tp22615577p22615979.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Issue with Facet Query

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Mar 20, 2009 at 1:14 PM, dabboo <ag...@sapient.com> wrote:

>
> Hi,
>
> I am searching the indexes with facet query. Below is the query.
>
>
> q=Answer&version=2.2&start=0&rows=10&indent=on&qt=dismaxrequest&facet=true&facet.field=productPrice_product_str_s:[0%20TO%2020]
>

facet.field takes a field name. It does not accept queries. Use facet.query
for getting count of a query. Use fq to restrict facets by a certain query.

See http://wiki.apache.org/solr/SimpleFacetParameters
-- 
Regards,
Shalin Shekhar Mangar.