tags:

views:

35

answers:

1

Let’s assume I have an index structured as below

    name | species | color
    -----+---------+------
    max  | cat     | grey
    sam  | dog     | brown
    luy  | cat     | white
    ...  | ...     | ...
    ...  | ...     | ...
    poe  | dog     | blond
    joe  | cat     | red
    pam  | dog     | brown

The species and color fields are tokenized, indexed and stored.

Now let’s assume that I want to change the term cat to feline and dog to canine.

From what I have been reading, I would have to delete each Document(row) and re-add it with the new term. Since the original cat and dog terms are Indexed, Tokenized and Stored, it seems like there should be a way to update just the terms cat and dog to their new titles.

Is there already a way to do this? Did I just miss it?

A: 

I highly doubt that field values can be changed without re-adding the documents. However, based on your hypothetical scenario, you may want to look into searching for synonyms of the search terms. For example, you could leave "cat" and "dog" in the index, but expand users' queries to also search for "feline" and "canine" respectively.

"cat" becomes "cat" AND "feline"

"dog" becomes "dog" AND "canine"

This functionality may come as a delight to your users if they are not aware of which terminology you have chosen in the index.

Adam Paynter