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 Thomas Portegys <th...@citrix.com> on 2013/05/18 00:08:32 UTC

Question about attributes

First time on forum.
We are planning to use Solr to house some data mining formation, and we are thinking of using attributes to add some semantic information to indexed content. As a test, I wrote a filter that adds an "animal" attribute to tokens like "dog", "cat", etc. After adding a document with my field (animal_text), the attribute shows up in the analysis tab for the collection, so it seems to have been processed. What I'm not sure of is how attributes are surfaced in the index for search, either via an URL or programmatically. Any advice is appreciated.


Re: Question about attributes

Posted by Jack Krupansky <ja...@basetechnology.com>.
Maybe you want to set the payload for each term, based on your animal 
attribute. Then there is minimal support in Solr for payloads. There is no 
immediate filter for capturing an arbitrary attribute.

Take a look at TypeAsPayloadTokenFilterFactory . You could do something 
similar, like AnimalAsPayloadTokenFilterFactory or a generalized 
AttributeAsPayloadTokenFilterFactory that takes the name of the attribute 
("animal").

-- Jack Krupansky

-----Original Message----- 
From: Thomas Portegys
Sent: Friday, May 17, 2013 6:08 PM
To: solr-user@lucene.apache.org
Subject: Question about attributes

First time on forum.
We are planning to use Solr to house some data mining formation, and we are 
thinking of using attributes to add some semantic information to indexed 
content. As a test, I wrote a filter that adds an "animal" attribute to 
tokens like "dog", "cat", etc. After adding a document with my field 
(animal_text), the attribute shows up in the analysis tab for the 
collection, so it seems to have been processed. What I'm not sure of is how 
attributes are surfaced in the index for search, either via an URL or 
programmatically. Any advice is appreciated.