What is Query-time and index-time?


(Parameswar Kurakula) #1

I was going through the Elastic search definitive guide where I came across query-time and index-time search-as-you-type topics. What do they actually mean? How do they differ from each other?


(Mark Harwood) #2

I'm not sure exactly which bit of the guide you're referring to but "query time" is in the context of tokenizing user search queries and "index time" is in the context of tokenizing document contents.

Most of the time the tokenization policy is the same for both to ensure searches match (e.g both sides lowercase input) but sometimes with things like injecting extra synonyms you want to do this on only one side.


(Parameswar Kurakula) #3

Index-time search-as-you-type
Query-time search-as-you-type
These were the things I was asking about.


(Mark Harwood) #4

OK - it looks like the distinction between the two articles is defined by another articles that sits in between them:

https://www.elastic.co/guide/en/elasticsearch/guide/2.x/_index_time_optimizations.html

"All of the solutions we’ve talked about so far are implemented at query time. They don’t require any special mappings or indexing patterns; they simply work with the data that you’ve already indexed."

So what that typically means is that those earlier "query time" solutions are designed to work with an index of whole-words (the default indexing strategy) and they have to do a lot of "if string contains" type work at query time. The "index time" approaches use more custom strategies to chop words into smaller pieces when indexing to support faster lookups of partial search terms.


(system) #5

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