Searching from structured data

In certain situations, we may want to find out whether a given document should be included or not; that is, a simple binary answer. On the other hand, there are other types of queries that are relevance-based. Such relevance-based queries also return a score against each document to say how well that document fits the query. Most structured queries do not need relevance-based scoring, and the answer is a simple yes/no for any item to be included or excluded from the result. These structured search queries are also referred to as term-level queries.

Let's understand the flow of a term-level query's execution:

Figure 3.2: Term-level query flow

As you can see, the figure is divided into two parts. The left-hand half of the figure depicts what happens at the time of indexing, and the right-hand half depicts what happens at the time of a query when a term-level query is executed.

Looking at the left-hand half of the figure, we can see what happens during indexing. Here, specifically, we are looking at how the inverted index is built and queried for the manufacturer.raw field. Remember, from our definition of the index, the manufacturer.raw field is of the keyword type. The keyword type fields are not analyzed; the field's value is directly stored as a term in the inverted index. 

At query time, when we search using a term query that is a term-level query, we see the flow of execution on the right-hand half of the figure. The term query, as we will see later in this section, is a term-level query that directly passes on the victory multimedia search term, without breaking it down using an analyzer. This is how term-level queries completely skip the analysis process at query time and directly search for the given term in the inverted index.

These term-level queries create a foundation layer on which other, high-level, full-text queries are built. We will look at high-level queries in the next section.

We will cover the following structured or term-level queries:

  • Range query
  • Exists query
  • Term query
  • Terms query
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.126.122