Is it possible to use variables in indexed documents in elasticsearch?

Is it possible to use variables in indexed documents in elasticsearch?

POST somki/_doc/
{
    "suggest": {
        "input": ["my name is x"]
        }
    }
}

I want to have x as variable so that when someone search something system should show value of x from another index based on user.

No, you cannot do that.

Is it possible to show suggestion as "Something is x and y" where x and y will be different for each user and will have multiple values and those which have highest weight will be shown?

I guess that depends how you are defining and weighing them.

Can you provide an example? I'm new to elasticsearch and did not find much on web about what I'm looking for. Thanks!

You need a way to define what these variables are per user and then define weights to them, how you do that isn't really an Elasticsearch thing it's how you structure your document.

Is it possible to show prefix in suggester from different index?
What I mean is, In documents if I store some strings in prefix field then they are being shown in suggestions but if I want to show prefix from other index, can it be done and how?

You'd have to write something entirely custom in your code for that I'd imagine.

Thanks

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