Index questions

I have some questions about the Chef Index. I’m just using it to search for nodes; I’m not trying to do any fancy custom indexes.

  1. When I use the search() function in a recipe, or if I make a REST request to “/search/node?..” , I get back multiple copies of each node. It appears each time time a node is saved (which happens multiple times during each run), a new copy is added to the index, instead of the new node overwriting the old one. Has anyone else noticed this behavior? Am I doing something wrong?

  2. Nodes never seem to get removed from the index. If I delete a Node via the web UI, or if I make a REST request to “/delete/node/…”, the node is deleted, but it remains in the index. Or at least, the node is still included in search results. (It appears that the hook for this the ‘destroy’ method in node.rb; a quick grep of the source doesn’t find a reference to this anywhere.)

Are there additional steps that need to be done in order to maintain the index?

-Nick

The best workaround that I can come up with is to make REST requests for all the nodes, and filter for the ones I want (i.e. a chef-node table-scan).

Are there better workarounds maybe?

-Nick

--- On Tue, 9/8/09, Nick nickychips@yahoo.com wrote:

From: Nick nickychips@yahoo.com
Subject: [chef] index questions
To: chef@lists.opscode.com
Date: Tuesday, September 8, 2009, 4:11 PM
I have some questions about the Chef
Index. I'm just using it to search for nodes; I'm not
trying to do any fancy custom indexes.

  1. When I use the search() function in a recipe, or if I
    make a REST request to "/search/node?..." , I get back
    multiple copies of each node. It appears each time
    time a node is saved (which happens multiple times during
    each run), a new copy is added to the index, instead of the
    new node overwriting the old one. Has anyone else
    noticed this behavior? Am I doing something wrong?

  2. Nodes never seem to get removed from the index. If
    I delete a Node via the web UI, or if I make a REST request
    to "/delete/node/...", the node is deleted, but it remains
    in the index. Or at least, the node is still included
    in search results. (It appears that the hook for this
    the 'destroy' method in node.rb; a quick grep of the source
    doesn't find a reference to this anywhere.)

Are there additional steps that need to be done in order to
maintain the index?

-Nick