How does the magic work? What is inside the indexes? Why is a certain
record found by a search, and another not?. The answer is in the
inverted indexes. You can easily investigate them using the
special Zebra schema
zebra::index::fieldname
. In this example you
can see that the title
index has both word
(type :w
) and phrase (type
:p
)
indexed fields,
http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=the&startRecord=1&maximumRecords=1&recordSchema=zebra::index::title
But where in the indexes did the term match for the query occur?
Easily answered with the special Zebra schema
zebra::snippet
. The matching terms are
encapsulated by <s>
tags.
http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=the&startRecord=1&maximumRecords=1&recordSchema=zebra::snippet
How can I refine my search? Which interesting search terms are
found inside my hit set? Try the special Zebra schema
zebra::facet::fieldname:type
. In this case, we
investigate additional search terms for the
title:w
index.
http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=the&startRecord=1&maximumRecords=1&recordSchema=zebra::facet::title:w
One can ask for multiple facets. Here, we want them from phrase
indexes of type
:p
.
http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=the&startRecord=1&maximumRecords=1&recordSchema=zebra::facet::publisher:p,title:p