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 Andreas Owen <ao...@swissonline.ch> on 2014/03/27 13:56:17 UTC

facet doesnt display all possibilities after selecting one

when i select a facet in "thema_f" all the others in the group disapear  
but the other facets keep the original findings. it seems like it should  
work. maybe the underscore is the wrong char for the seperator?

example documents in index

  <doc>
     <arr name="thema_f">
       <str>1_Produkte</str>
     </arr>
     <str name="id">dms:381</str>
</doc>
   <doc>
     <arr name="thema_f">
       <str>1_Beratung</str>
       <str>1_Beratung_Beratungsportal PK</str>
     </arr>
     <str name="id">dms:2679</str>
</doc>
   <doc>
     <arr name="thema_f">
       <str>1_Beratung</str>
       <str>1_Beratung_Beratungsportal PK</str>
     </arr>
     <str name="id">dms:190</str>
</doc>



solrconfig.xml

<requestHandler name="/select2" class="solr.SearchHandler">
      <lst name="defaults">
        <str name="echoParams">explicit</str>
        <int name="rows">10</int>
        <str name="defType">synonym_edismax</str>
	   <str name="synonyms">true</str>
	   <str name="qf">plain_text^10 editorschoice^200
		title^20 h_*^14
		tags^10 thema^15 inhaltstyp^6 breadcrumb^6 doctype^10
		productsegment^5 productgroup^5 contentmanager^5 links^5
		last_modified^5	url^5
	   </str>
	   <str name="bq">(expiration:[NOW TO *] OR (*:* -expiration:*))^6</str>
	   <str name="bf">div(clicks,max(displays,1))^8</str> <!-- tested -->
	
        <str name="df">text</str>
	   <str name="fl">*,path,score</str>
	   <str name="wt">json</str>
	   <str name="q.op">AND</str>
	
	   <!-- Highlighting defaults -->
        <str name="hl">on</str>
        <str name="hl.fl">plain_text,title</str>
	   <str name="hl.fragSize">200</str>
	   <str name="hl.simple.pre">&lt;b&gt;</str>
        <str name="hl.simple.post">&lt;/b&gt;</str>

		<!-- <lst name="invariants"> -->
	    <str name="facet">on</str>
		<str name="facet.mincount">1</str>
		<str name="facet.missing">false</str>
         <str name="facet.field">{!ex=inhaltstyp_s}inhaltstyp_s</str>
		<str name="f.inhaltstyp_s.facet.sort">index</str>
		<str name="facet.field">{!ex=doctype}doctype</str>
		<str name="f.doctype.facet.sort">index</str>
		<str name="facet.field">{!ex=thema_f}thema_f</str>
		<str name="f.thema_f.facet.sort">index</str>
		<str name="facet.field">{!ex=productsegment_f}productsegment_f</str>
		<str name="f.productsegment_f.facet.sort">index</str>
		<str name="facet.field">{!ex=productgroup_f}productgroup_f</str>
		<str name="f.productgroup_f.facet.sort">index</str>
		<str name="facet.field">{!ex=author_s}author_s</str>
		<str name="f.author_s.facet.sort">index</str>
		<str  
name="facet.field">{!ex=sachverstaendiger_s}sachverstaendiger_s</str>
		<str name="f.sachverstaendiger_s.facet.sort">index</str>
		<str name="facet.field">{!ex=veranstaltung_s}veranstaltung_s</str>
		<str name="f.veranstaltung_s.facet.sort">index</str>
		<str  
name="facet.field">{!ex=kundensegment_aktive_beratung}kundensegment_aktive_beratung</str>
		<str name="f.kundensegment_aktive_beratung.facet.sort">index</str>
		<str name="facet.date">{!ex=last_modified}last_modified</str>
			<str name="facet.date.gap">+1MONTH</str>
			<str name="facet.date.end">NOW/MONTH+1MONTH</str>
			<str name="facet.date.start">NOW/MONTH-36MONTHS</str>
			<str name="facet.date.other">after</str>
</lst>
	</requestHandler>




schema.xml

<fieldType name="text_thema" class="solr.TextField"  
positionIncrementGap="100">
	 <!-- <analyzer>
		<tokenizer class="solr.PatternTokenizerFactory" pattern="_"/>
	</analyzer>-->

	 <analyzer type="index">
		<tokenizer class="solr.KeywordTokenizerFactory"/>
	 </analyzer>
	 <analyzer type="query">
		<tokenizer class="solr.KeywordTokenizerFactory"/>
		
      </analyzer>
     </fieldType>

Re: facet doesnt display all possibilities after selecting one

Posted by Yonik Seeley <yo...@heliosearch.com>.
On Thu, Mar 27, 2014 at 8:56 AM, Andreas Owen <ao...@swissonline.ch> wrote:
> when i select a facet in "thema_f" all the others in the group disapear

OK, I see you're excluding filters tagged with "thema_f" when faceting
on the "thema_f" field.

>                 <str name="facet.field">{!ex=thema_f}thema_f</str>

Now all you should need to do is tag the right filter with that when
you "select" the facet.

fq={!tag=thema_f}thema_f:1_Beratung

http://wiki.apache.org/solr/SimpleFacetParameters#Multi-Select_Faceting_and_LocalParams

-Yonik
http://heliosearch.org - solve Solr GC pauses with off-heap filters
and fieldcache




> but
> the other facets keep the original findings. it seems like it should work.
> maybe the underscore is the wrong char for the seperator?
>
> example documents in index
>
>  <doc>
>     <arr name="thema_f">
>       <str>1_Produkte</str>
>     </arr>
>     <str name="id">dms:381</str>
> </doc>
>   <doc>
>     <arr name="thema_f">
>       <str>1_Beratung</str>
>       <str>1_Beratung_Beratungsportal PK</str>
>     </arr>
>     <str name="id">dms:2679</str>
> </doc>
>   <doc>
>     <arr name="thema_f">
>       <str>1_Beratung</str>
>       <str>1_Beratung_Beratungsportal PK</str>
>     </arr>
>     <str name="id">dms:190</str>
> </doc>
>
>
>
> solrconfig.xml
>
> <requestHandler name="/select2" class="solr.SearchHandler">
>      <lst name="defaults">
>        <str name="echoParams">explicit</str>
>        <int name="rows">10</int>
>        <str name="defType">synonym_edismax</str>
>            <str name="synonyms">true</str>
>            <str name="qf">plain_text^10 editorschoice^200
>                 title^20 h_*^14
>                 tags^10 thema^15 inhaltstyp^6 breadcrumb^6 doctype^10
>                 productsegment^5 productgroup^5 contentmanager^5 links^5
>                 last_modified^5 url^5
>            </str>
>            <str name="bq">(expiration:[NOW TO *] OR (*:*
> -expiration:*))^6</str>
>            <str name="bf">div(clicks,max(displays,1))^8</str> <!-- tested
> -->
>
>        <str name="df">text</str>
>            <str name="fl">*,path,score</str>
>            <str name="wt">json</str>
>            <str name="q.op">AND</str>
>
>            <!-- Highlighting defaults -->
>        <str name="hl">on</str>
>        <str name="hl.fl">plain_text,title</str>
>            <str name="hl.fragSize">200</str>
>            <str name="hl.simple.pre">&lt;b&gt;</str>
>        <str name="hl.simple.post">&lt;/b&gt;</str>
>
>                 <!-- <lst name="invariants"> -->
>             <str name="facet">on</str>
>                 <str name="facet.mincount">1</str>
>                 <str name="facet.missing">false</str>
>         <str name="facet.field">{!ex=inhaltstyp_s}inhaltstyp_s</str>
>                 <str name="f.inhaltstyp_s.facet.sort">index</str>
>                 <str name="facet.field">{!ex=doctype}doctype</str>
>                 <str name="f.doctype.facet.sort">index</str>
>                 <str name="facet.field">{!ex=thema_f}thema_f</str>
>                 <str name="f.thema_f.facet.sort">index</str>
>                 <str
> name="facet.field">{!ex=productsegment_f}productsegment_f</str>
>                 <str name="f.productsegment_f.facet.sort">index</str>
>                 <str
> name="facet.field">{!ex=productgroup_f}productgroup_f</str>
>                 <str name="f.productgroup_f.facet.sort">index</str>
>                 <str name="facet.field">{!ex=author_s}author_s</str>
>                 <str name="f.author_s.facet.sort">index</str>
>                 <str
> name="facet.field">{!ex=sachverstaendiger_s}sachverstaendiger_s</str>
>                 <str name="f.sachverstaendiger_s.facet.sort">index</str>
>                 <str
> name="facet.field">{!ex=veranstaltung_s}veranstaltung_s</str>
>                 <str name="f.veranstaltung_s.facet.sort">index</str>
>                 <str
> name="facet.field">{!ex=kundensegment_aktive_beratung}kundensegment_aktive_beratung</str>
>                 <str
> name="f.kundensegment_aktive_beratung.facet.sort">index</str>
>                 <str
> name="facet.date">{!ex=last_modified}last_modified</str>
>                         <str name="facet.date.gap">+1MONTH</str>
>                         <str name="facet.date.end">NOW/MONTH+1MONTH</str>
>                         <str
> name="facet.date.start">NOW/MONTH-36MONTHS</str>
>                         <str name="facet.date.other">after</str>
> </lst>
>         </requestHandler>
>
>
>
>
> schema.xml
>
> <fieldType name="text_thema" class="solr.TextField"
> positionIncrementGap="100">
>          <!-- <analyzer>
>                 <tokenizer class="solr.PatternTokenizerFactory"
> pattern="_"/>
>         </analyzer>-->
>
>          <analyzer type="index">
>                 <tokenizer class="solr.KeywordTokenizerFactory"/>
>          </analyzer>
>          <analyzer type="query">
>                 <tokenizer class="solr.KeywordTokenizerFactory"/>
>
>      </analyzer>
>     </fieldType>