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 prerna07 <pk...@sapient.com> on 2008/10/21 15:57:03 UTC

Issues with facet

Hi,

On using Facet in solr query I am facing various issues.

Scenario 1:
I have 11 Index with tag : <str name="Index_Type_s">productIndex</str> 

my search query is appended by facet  parameters :
facet=true&facet.field=Index_Type_s&qt=dismaxrequest

The facet node i am getting in solr result is :
 
- <lst name="facet_fields">
- <lst name="Index_Type_s">
          <int name="index">11</int> 
          <int name="product">11</int> 
          <int name="productindex">11</int> 
  </lst>
  

According to my understanding I should get only one result, which should be
like the below mentioned node
<lst name="facet_fields">
- <lst name="Index_Type_s">
         <int name="productindex">11</int> 
  </lst>

Scenario 2: 

My index has following fields :
 <str name="productDescription_s">In Search of the Shape of the Universe,
mathamatics</str> 

My search Query is : 
facet=true&facet.field=productDescription_s&qt=dismaxrequest

The result Solr is giving displaying :

<lst name="facet_fields">
- <lst name="productDescription_s">
  <int name="in">1</int> 
  <int name="search">1</int> 
  <int name="of">2</int> 
  <int name="shap">1</int> 
  <int name="mathamat">1</int> 
</lst>

I am not able to figure out the facet results. It does noyt contain any 
result of Universe, It also removes characters from matahmatics and shape.

Please help me understanding the issue and let me know if any change in
schema / solrConfig can solve the issue.

Thanks,
Prerna






-- 
View this message in context: http://www.nabble.com/Issues-with-facet-tp20090842p20090842.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Issues with facet

Posted by Jeremy Hinegardner <je...@hinegardner.org>.
On Tue, Oct 21, 2008 at 06:57:03AM -0700, prerna07 wrote:
> 
> Hi,
> 
> On using Facet in solr query I am facing various issues.
> 
> Scenario 1:
> I have 11 Index with tag : <str name="Index_Type_s">productIndex</str> 
> 
> my search query is appended by facet  parameters :
> facet=true&facet.field=Index_Type_s&qt=dismaxrequest
> 
> The facet node i am getting in solr result is :
>  
> - <lst name="facet_fields">
> - <lst name="Index_Type_s">
>           <int name="index">11</int> 
>           <int name="product">11</int> 
>           <int name="productindex">11</int> 
>   </lst>

What does your schema look like?  I am guessing you are using dynamic fields and
have an analyzer on the type for fields that are '*_s' that uses
WordDelimiterFilterFactory with generateWordParts="1".

  http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters

Since facets use the indexed values not the stored values, the indexed value
for "productIndex" would be 3 terms 'product', 'index' and 'productindex'

> 
> According to my understanding I should get only one result, which should be
> like the below mentioned node
> <lst name="facet_fields">
> - <lst name="Index_Type_s">
>          <int name="productindex">11</int> 
>   </lst>
> 
> Scenario 2: 
> 
> My index has following fields :
>  <str name="productDescription_s">In Search of the Shape of the Universe,
> mathamatics</str> 
> 
> My search Query is : 
> facet=true&facet.field=productDescription_s&qt=dismaxrequest
> 
> The result Solr is giving displaying :
> 
> <lst name="facet_fields">
> - <lst name="productDescription_s">
>   <int name="in">1</int> 
>   <int name="search">1</int> 
>   <int name="of">2</int> 
>   <int name="shap">1</int> 
>   <int name="mathamat">1</int> 
> </lst>
> 
> I am not able to figure out the facet results. It does noyt contain any 
> result of Universe, It also removes characters from matahmatics and shape.
> 
> Please help me understanding the issue and let me know if any change in
> schema / solrConfig can solve the issue.

I believe that both of these are a result of the Analyzer you are using on your
'*_s' fields.

> 
> Thanks,
> Prerna

enjoy,

-jeremy

-- 
========================================================================
 Jeremy Hinegardner                              jeremy@hinegardner.org 


Re: Issues with facet

Posted by prerna07 <pk...@sapient.com>.

Thanks, it helped.

We were using *_s fields which had analyser section.

We used <copyfield>  to copy all fields in some other field type and used
this new type in facet. It is working fine now.

Thanks,
Prerna


prerna07 wrote:
> 
> Hi,
> 
> On using Facet in solr query I am facing various issues.
> 
> Scenario 1:
> I have 11 Index with tag : <str name="Index_Type_s">productIndex</str> 
> 
> my search query is appended by facet  parameters :
> facet=true&facet.field=Index_Type_s&qt=dismaxrequest
> 
> The facet node i am getting in solr result is :
>  
> - <lst name="facet_fields">
> - <lst name="Index_Type_s">
>           <int name="index">11</int> 
>           <int name="product">11</int> 
>           <int name="productindex">11</int> 
>   </lst>
>   
> 
> According to my understanding I should get only one result, which should
> be like the below mentioned node
> <lst name="facet_fields">
> - <lst name="Index_Type_s">
>          <int name="productindex">11</int> 
>   </lst>
> 
> Scenario 2: 
> 
> My index has following fields :
>  <str name="productDescription_s">In Search of the Shape of the Universe,
> mathamatics</str> 
> 
> My search Query is : 
> facet=true&facet.field=productDescription_s&qt=dismaxrequest
> 
> The result Solr is giving displaying :
> 
> <lst name="facet_fields">
> - <lst name="productDescription_s">
>   <int name="in">1</int> 
>   <int name="search">1</int> 
>   <int name="of">2</int> 
>   <int name="shap">1</int> 
>   <int name="mathamat">1</int> 
> </lst>
> 
> I am not able to figure out the facet results. It does noyt contain any 
> result of Universe, It also removes characters from matahmatics and shape.
> 
> Please help me understanding the issue and let me know if any change in
> schema / solrConfig can solve the issue.
> 
> Thanks,
> Prerna
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Issues-with-facet-tp20090842p20123830.html
Sent from the Solr - User mailing list archive at Nabble.com.