Suppose I have a record that looks like this:
{
"title": "Random title",
"authors": [
{
"first": "Jordan",
"last": "Reiter"
… more fields here …
},
{
"first": "Joe",
"last": "Schmoe"
… more fields here …
},
]
}
I would like users to be able to search records by author, and if they enter the full query Jordan Reiter it pulls up this record (and others where at least one of the authors matches these fields.
I don't want the user to have to specify the first/last field and I won't necessarily know if they are searching Jordan Reiter Reiter Jordan or even J Reiter so ideally I'd like to match all of these cases while still filtering it so that, for example, none of these records match:
{
"title": "About Jordan Reiter",
"authors": [
{
"first": "Susan",
"last": "Schmusan"
… more fields here …
}
]
}
{
"title": "Completely different authors",
"authors": [
{
"first": "Robert",
"last": "Jordan"
… more fields here …
},
{
"first": "Samuel",
"last": "Reiter"
… more fields here …
},
]
}
Just starting out in ElasticSearch so if there's a basic concept I'm missing let me know.
I'm planning on having the authors field be a nested type.