On Wed, Dec 22, 2010 at 3:53 PM, Hasnain <hasn...@hotmail.com> wrote: [...] > In my schema, i have another field by the name of "Category" and, for > example's sake, let's assume that my application supports only two > categories: computers and accessories. Now, what i require is a mechanism to > assign correct categories to the items during item indexing so that this > field can be used to better filter the search results. Continuing from the > example in my original post, item A would belong to "Computer" category and > item B would belong to "Accessories" category. So then, searching for > "Laptop" would only look for items in the "Computers" category and return > item A only. > > I would like to point out here that setting the category field manually is > not an option since the data might be in the vicinity of thousands of > records. I am not asking for an in-depth algorithm. Just a high level design > would be sufficient to set me in the right direction. [...]
How do you do your indexing? You would need to have the indexer decide on what the proper category for a document should be, and add that value to the category field. Depending on your requirements, it might be possible to use synonyms in Solr to arrive at something like this. Other than that, Solr has no mechanism to automatically assign a category. You could possibly look at things like Apache Mahout to help you here. Regards, Gora