Reputation: 320
Being not really familiar with nosql databases, I currently wonder about the following: I have a lucene search index which searches through the complete database and:
function (doc) {
index("default", doc.name);
index("name", doc.name, {"store": true, "index": false});
if (doc.description) {
index("default", doc.description);
index("description", doc.description, {"store": true, "index": false});
}
if (doc.steps) {
for (var i = 0; i < doc.steps.length; i++){
index("default", doc.steps[i].description);
}
}
}
It should work with user provided queries later on. Now I somehow have to handle restrictions to certain documents. Is it possible to do something like this (sqlish):
SELECT id, name, description FROM Table WHERE id IN (<Lucene search>) AND <restriction>;
Creating a view on top of the search results. Is this possible, or is there a more efficient option?
Upvotes: 0
Views: 70
Reputation: 5637
It is not possible to create a "view on top of search results", but it is certainly possible to answer your SQL(ish) query with either
Without knowing too much about what you mean by , I would tackle this as an extension of your existing Lucene search.
The query you specify against your Lucene index can be pretty complex - you can have logic and brackets in there, just like a SQL WHERE clause e.g.
q=name:"Bob Smith" AND description:"database expert" AND ( owner:"glynn" OR group_owner:"staff" OR world_owner:"everyone")
In the above example, I return documents matching the query but only if one of three "restriction" parameters is met - modelled on the three-tier file ownership of Unix (you may pick another access control scheme).
Upvotes: 1