[TYPO3-Solr] jumbled facets

Ingo Renner ingo at typo3.org
Tue Jan 17 15:07:03 CET 2012


Am 17.01.12 02:52, schrieb Michael Mcmanus:

Hi Michael,

> I've configured a mutivalue field, in an indexer. I've followed the
> tt_news example for the keywords fields and my TS looks like this:
> 
> keywords = SOLR_MULTIVALUE
> keywords {
>     field = keywords
> }
> 
> The records appear to get indexed properly. Querying Solr directly,
> yields a response like this:
...
> When I try to query for facets, the "keywords" values get all jumbled.
...
> Produces this result:
...
> So, "Photography" gets turned into "photographi", "explosion" becomes
> "explos," etc...

That behavior is correct basically. The keywords field is of type
"text", text is a field type that uses stemming, thus the "jumbled" results.

For facets I recommend to use field types that do not do stemming, like
string. Since you don't want to modify the schema you just use a dynamic
field:

keywords_stringM = SOLR_MULTIVALUE
keywords_stringM {
  field = keywords
}

Now just use that keywords_stringM field to create the facet.

So "keywords" is a name you can choose on your own, then it is followed
by an underscore (_) to separate the name from the type, "string" is the
type and lastly "M" marks a multivalue field, whereas "S" would be
single value.

You can have a look at the end in
EXT:solr/resources/solr/typo3cores/conf/general_schema_fields.xml for
all the dynamic field types that are available.


best
Ingo

-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2, Admin Google Summer of Code

TYPO3 - Open Source Enterprise Content Management System
http://typo3.org

Apache Solr for TYPO3 -
Open Source Enterprise Search meets Open Source Enterprise CMS
http://www.typo3-solr.com


More information about the TYPO3-project-solr mailing list