Hello,
We are working on setting up a search with document contents (pdf/docx etc.) where permissions comes from a database.
I've gotten all the data into Elastic with the help of Logstash and FSCrawler.
However they are two different indexes and I'm out of ideas how to "merge" them. From someone who comes from doing lots of SQL, I would use JOIN on those indexes to a new view to search on content (from the index created by FSCrawler) with the permissions coming from SQL server Logstash.
The Logstash index has a column "filename" which matches "path.virtual" from FSCrawler.
This is how I search a document contents:
GET /view-doc/_search
{
"query": {
"query_string" : {
"query" : "Exam test",
"default_field": "content"
}
}
}
This is how I search the index containing the permission array:
GET /db-view/_search
{
"query": {
"bool" : {
"must": [
{
"query_string": {
"query": "search term db view"
}
}
],
"should" : [
{ "term" : { "role_ids": "305" } },
{ "term" : { "role_ids" : "306" } }
],
"minimum_should_match" : 1,
"boost" : 1.0
}
}
}
How can I query both indexes having them joined on the filename column, and filtered on the permissions array?