As part of a proof-of-concept for a bill-of-materials (BOM) explosion database in CouchDB, I used CouchDB-Lucene. Here are a few quick screenshots of how I got it to work. I will fill in the details in a future post.The sample document format shows an “item” that is made up of several “components” that are identified by a “part_number” and a “part_name.”
![Sample Document Format](https://mark.the-fennells.org/wp-content/uploads/2014/11/couchdb-lucene_000-300x205.png)
Next, here is the text of the index function used to index the items with components and each component’s parts details.
![Lucene Function to Index Component Arrays](https://mark.the-fennells.org/wp-content/uploads/2014/11/couchdb-lucene_001-300x205.png)
Finally, the search results from the following URL:
http://127.0.0.1:5984/_fti/local/bulk/_design/lucene/parts?q=part_name:in*&force_json=true&include_docs=true
![Search Results](https://mark.the-fennells.org/wp-content/uploads/2014/11/couchdb-lucene_002-300x205.png)
Leave a Reply
You must be logged in to post a comment.