Implementiing "Partial match anywhere"

Hi

I'm trying to do a partial match anywhere search over medical terminologies. I've created any index with a multi-filed mapping of ngrams AND standard tokens.
Unfortunately I can't get a good relevance score in the case where a full word and an fragment is typed.

It seems that that full word+segment with AND operator is not a match on the standard index, but without the AND operator false positives come up (but otherwise the result ordering is pretty ok). If I use the AND operator, the standard/english query returns with a 0 and while there are no false positives, matching only one of the terms, the ordering becomes messed up.
This is my latest try:

    "query": {
    "dis_max": {
        "queries": [{
            "multi_match": {
                "query": expr,
                "operator": "AND",
                "type": "most_fields",
                "fields": [field, field + ".std^4"]
            }
        },
            {
                "multi_match": {
                    "query": expr,
                    "type": "most_fields",
                    "fields": [field + ".std^4"]
                }
            }
        ]
    }

Is there a standard way to solve this issue? (I forgot to mention that I'm new to ES and only read half of the definitive guide so far)

Experimenting further, it seems that splitting the expression to words and creating a bool-should for each of them increases the quality of the search results a lot. The false positives still show up though, but with lower relevance.
Nonetheless I'd be interested in any advice to filter them out completely
> {

            "bool": {
                "should": [
                    {
                        "term": {
                            "en.std": "neurological"
                        }
                    },
                    {
                        "term": {
                            "en.std": "diso"
                        }
                    }
                ]
            }
        }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.