<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Andrey Abramov on Medium]]></title>
        <description><![CDATA[Stories by Andrey Abramov on Medium]]></description>
        <link>https://medium.com/@andrey.arangodb?source=rss-4511d73bc15a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DAv2OYVHWU_j6G04cNokaQ.jpeg</url>
            <title>Stories by Andrey Abramov on Medium</title>
            <link>https://medium.com/@andrey.arangodb?source=rss-4511d73bc15a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 03:31:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@andrey.arangodb/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ArangoSearch Architecture Overview]]></title>
            <link>https://medium.com/@andrey.arangodb/arangosearch-architecture-overview-a20481f2baa5?source=rss-4511d73bc15a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a20481f2baa5</guid>
            <category><![CDATA[arangodb]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[search]]></category>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[graph]]></category>
            <dc:creator><![CDATA[Andrey Abramov]]></dc:creator>
            <pubDate>Tue, 26 Jun 2018 14:10:49 GMT</pubDate>
            <atom:updated>2018-06-26T14:10:49.752Z</atom:updated>
            <content:encoded><![CDATA[<p>ArangoSearch Architecture Overview</p><p>In this article, we’re going to dive deeper into our recently released feature preview in <a href="https://www.arangodb.com/2018/01/milestone-arangodb-3-4-arangosearch-information-retrieval/">Milestone ArangoDB 3.4</a> — ArangoSearch which provides a rich set of information retrieval capabilities. In particular, we’ll give you an idea of how our search engine works under the hood.</p><p>Essentially ArangoSearch consists of 2 components: A <a href="https://github.com/iresearch-toolkit/iresearch">search engine</a> and an integration layer. The former is responsible for managing the index, querying and scoring, whereas latter exposes search capabilities to the end user in a convenient way.</p><h3>ArangoSearch index</h3><p>Inverted Index is the heart of ArangoSearch. The index structure and index management approach are inspired by well-known search engine Lucene.</p><p>The index consists of several independent segments and the index segment itself is meant to be treated as a standalone index. Each segment contains the following components:</p><ul><li><strong>Term dictionary</strong> is responsible for storing and providing fast access to all terms (and its metadata) ever seen in a segment</li><li><strong>Posting lists</strong> are storing and providing fast access to information about documents, term positions, payloads for each seen term</li><li><strong>Segment metadata</strong> is responsible for storing different segment related properties</li><li><strong>Tombstones</strong> contains documents that have been deleted but not yet purged from the storage</li><li><strong>Columnstore</strong> is responsible for storing and providing fast access to arbitrary information on per column basis</li></ul><p>The following picture gives you a basic understanding of how ArangoSearch index logically looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/0*mVofa-cd7LOYXCI9.png" /></figure><p>Typically, an ArangoSearch query iterates over all segments in the index, finds documents satisfying search criteria and returns them to the caller. We’re going to dive deeper into index structure and management in the upcoming articles but for now let’s talk about the integration layer.</p><h3>ArangoSearch integration layer</h3><p>The integration layer tries to hide all complexity behind maintaining the index and exposes all functionality via convenient ArangoDB APIs.</p><h3>DML integration</h3><p>ArangoDB is a multi-model database which allows you to store your data as key/value pairs, documents and graphs. Because of such native multi-model approach seamless integration of search engine becomes quite complicated.</p><p>The following scheme gives you an idea of how data appear in ArangoSearch index.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/0*Sho3eVIZn0c13gYd.png" /></figure><p>Once created a view may have arbitrary number of ArangoSearch links between collections of any type and a view. Essentially a link is a unidirectional connection from ArangoDB collection to an ArangoSearch view. The ArangoSearch link created on a collection operates like an index with the only difference that it does nothing but delegate all incoming requests to a corresponding view.<br>The ArangoSearch link contains information of how data is coming from a collection should be indexed, in particular:</p><ul><li>which fields have to be indexed (or all)</li><li>which analyzers have to be applied to a fields</li><li>how deep hierarchical JSON documents have to be processed</li><li>how lists/arrays have to be indexed in terms of individual position tracking</li></ul><p>All these properties are very important since they affect the upcoming querying phase.</p><h3>Eventually read committed</h3><p>In order to speed up indexing, the ArangoSearch view processes modification requests coming from ArangoSearch link on a batch basis. From time to time an asynchronous job commits accumulated data creating new index segments. Data is being visible right after the commit, so that speaking of transaction isolation, ArangoSearch view is on the eventually read committed level.<br>There are 2 separate indexes per each view: in-memory index and persistent index. All documents coming from the links first get into the in memory index and eventually (in asynchronous fashion) appear to be in the latter. Having 2 separate indexes is the crucial part for fast startup and recovery since ArangoSearch views don’t need to reindex all data from linked collections. Merging memory part into persistent store is also quite important since ArangoSearch view doesn’t want to consume all your RAM.</p><h3>Managing data consistency</h3><p>ArangoSearch view does not store any data except the “references” to documents, which means that view always relies on data in the linked collection(s). That actually obliges ArangoDB to maintain data consistency between data in collection(s) and view(s) so that in the event of a crash and following recovery an ArangoSearch view will appear to be in a consistent state.<br>In order to provide such guarantees, ArangoDB stores some information about the current view(s) state in WAL and uses it later for recovery.<br>Since ArangoSearch view eventually reads documents from linked collections within a scope of transaction it guarantees to be consistent with the data.</p><h3>Removals and consolidation</h3><p>ArangoSearch view handles removals in a two steps fashion pretty similar to collections in ArangoDB. Once removal request arrived, ArangoSearch view first marks document as deleted which means that particular document will be filtered out of query result. At this point document is still in the index but the data itself is a garbage. As one can imagine there will be a lot of such garbage documents eventually which causes slower queries and high memory consumption.<br>In order to avoid such nasty situation ArangoSearch has built-in support of index consolidation. Index consolidation is meant to be treated as the procedure of joining multiple index segments into a bigger one and removing garbage documents. Merging also reduces number of segments to traverse which is speeding up queries.<br>There are number of built-in consolidation policies one can choose according to its own load, e.g. based on average segment size or number of deleted documents per segment. For more information please consult our <a href="https://docs.arangodb.com/latest/Manual/Views/ArangoSearch.html#view-properties-modifiable">documentation</a>.</p><p>In this article we’ve described high level architecture of recently introduced ArangoSearch views. A lot of things has been already done but even more to come: now we’re focused on AQL integration improvements and cluster-wide views support of course. Stay in touch!<br>Join #arangosearch channel on our <a href="https://slack.arangodb.com/">Community Slack</a> to give us feedback, improvement suggestions, if you have any questions or just to chat with us.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a20481f2baa5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Milestone ArangoDB 3.4: ArangoSearch — Information retrieval with ArangoDB]]></title>
            <link>https://medium.com/@andrey.arangodb/milestone-arangodb-3-4-arangosearch-information-retrieval-with-arangodb-633456e4f2d6?source=rss-4511d73bc15a------2</link>
            <guid isPermaLink="false">https://medium.com/p/633456e4f2d6</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[arangodb]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Andrey Abramov]]></dc:creator>
            <pubDate>Mon, 05 Mar 2018 16:03:55 GMT</pubDate>
            <atom:updated>2018-03-05T16:03:55.437Z</atom:updated>
            <content:encoded><![CDATA[<p>For the upcoming ArangoDB 3.4 release we’ve implemented a set of information retrieval features exposed via new database object View. The View object is meant to be treated as another data source accessible via AQL and the concept itself is pretty similar to a classical “materialized” view in SQL.</p><p>While we are still working on completing the feature, you can already try our retrieval engine in the Milestone of the upcoming ArangoDB 3.4. You can download and give it a spin <a href="https://www.arangodb.com/download-technical-preview/"><em>here</em></a><em>.</em></p><h3>The retrieval concept</h3><p>When dealing with unstructured or semi-structured data a user usually has only a vague assumption of what she is looking for. That means when executing a query she is not only interested in datasets that just satisfy search criteria but particularly the most relevant ones.</p><p>In order to achieve that we combined two information retrieval models: <a href="https://en.wikipedia.org/wiki/Standard_Boolean_model">boolean</a> and generalized <a href="https://en.wikipedia.org/wiki/Ranking_(information_retrieval)">ranking</a> retrieval so that each document “approved” by boolean model gets its own rank from the ranking model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*dmqZi8USL8jVuEhH.png" /></figure><p>Since analysis and ranking phases are application dependent we will allow using your own plugins in future releases. As for this Milestone of the upcoming ArangoDB 3.4 release, we’ve implemented a set of analyzers and rankers that are mostly related to text processing.</p><h3>Improved full-text search</h3><p>For text retrieval, we use the <a href="https://en.wikipedia.org/wiki/Vector_space_model">Vector Space Model (VSM)</a> as the ranking model. According to the model, documents and query are represented as vectors in a space formed by the <em>“terms”</em> of the query. The definition of <em>“term”</em> depends on the analysis phase of the application. Typically terms are single words, keywords or even phrases.</p><p>The document vectors that are closer to a query vector are more relevant. Practically the closeness is expressed as the cosine of the angle between two vectors, namely <a href="https://en.wikipedia.org/wiki/Cosine_similarity">cosine similarity</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*85E_63uwADXpCsvK.png" /></figure><p>In order to define how relevant document d to the query q we have to evaluate the following expression:<br> <em>cos</em> a = (<em>d</em> * <em>q</em>) / (|<em>d</em>| * |<em>q</em>|), where<br> <em>d</em> * <em>q</em> is the dot product of the query vector <em>q</em> and document vector <em>d</em>,<br> |<em>d</em>| is the norm of the vector <em>d</em>,<br> |<em>q</em>| is the norm of the vector <em>q</em></p><p>To evaluate relevance described above we have to compute vector components at first. Since we are in a space formed by the <em>“terms”</em> we use <em>“term weights”</em> as the coordinates. There are number of probability/statistical weighting models but for this Milestone release we’ve implemented two, probably the most famous schemes:</p><ul><li><a href="https://en.wikipedia.org/wiki/Okapi_BM25">Okapi BM25</a></li><li><a href="https://en.wikipedia.org/wiki/Tf%E2%80%93idf">TFIDF</a></li></ul><p>Under the hood both models rely on 2 main components:</p><ul><li><a href="https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Term_frequency">Term frequency (TF)</a> in the simplest case defined as the number of times that term t occurs in document d</li><li><a href="https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Inverse_document_frequency">Inverse document frequency (IDF)</a> is a measure of how much information the word provides, i.e. whether the term is common or rare across all documents</li></ul><h3>Comparison with ArangoDB full-text index</h3><p>The current full-text index in ArangoDB is rather limited in terms of functionality. With the upcoming ArangoDB 3.4 release, we will overcome these limitations and provide a complete text searching, matching and ranking suite. The following table contains view/index feature comparison:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*SZmhRDbQLItWLa_uz8fFaw.png" /></figure><h3>Improved text analysis</h3><p>Milestone version comes with a set of built-in text analyzers which support configurable <a href="https://en.wikipedia.org/wiki/Stemming">stemming</a>, <a href="https://en.wikipedia.org/wiki/Stop_words">stopwords</a> and multilingual support (including Chinese, Russian and other languages).</p><p>If you’re interested in usage examples go through this extensive <a href="https://www.arangodb.com/tutorials/arangosearch/">ArangoSearch tutorial</a> or visit our <a href="https://docs.arangodb.com/3.4/Manual/Views/ArangoSearch.html#analyzers">documentation</a>.</p><h3>Schema agnostic indexing</h3><p>Data structures like “B-tree” or “skip-list” derived from the relational world allow to seriously speedup data access by the specified attribute(s) but they have serious drawback: DBA has to predict what the user wants to find, in order to create and maintain proper indexes on collections which is not always trivial especially in schema-less world.</p><p>We utilize the simplicity of JSON and its schema manipulation in order to eliminate data delivery mismatch between the database and the user’s expectation from schema-less database. Schema agnostic indexing is meant to be treated as the ability to index any JSON attribute at any depth or the given set of paths, allowing fast access to documents via any combination of conditions over the indexed attributes. Unlike the collections with user-defined indexes, view guarantees the best execution plan <em>(merge join)</em> when querying multiple attributes.</p><h3>Federated retrieval</h3><p>Once view has been created one may establish an arbitrary number of links between collections (of any type) and a view. That especially useful when one needs to retrieve and analyze data from multiple collections based on some conditions, e.g. find the most relevant goods or books according to a given description. Each link is meant to be treated as the data flow from a collection to a view so that data from a collection will be accessible via the view object. ArangoSearch view gives you full control over the data coming from a particular collection allowing to specify what and how should be indexed.</p><h3>Graph dualism</h3><p>Since essentially graph is a combination of document and edge collections, it might be indexed by a view as well. With such approach, graph can be treated as flat and interconnected data structure simultaneously. Dual approach allows combining information retrieval techniques with sophisticated graph traversals in order to speed up data access by a factor of magnitude, e.g. one can find the most relevant vertices according to a provided description and then do a regular traversal within a specified depth.</p><p>You can find more information regarding setting up indexing properties for view here: Extensive <a href="https://www.arangodb.com/tutorials/arangosearch/">ArangoSearch Tutorial</a> or <a href="https://docs.arangodb.com/3.4/Manual/Views/ArangoSearch.html#links-to-arangodb-collections">documentation</a>.</p><h3>Future plans</h3><p>For upcoming releases we plan to implement more exciting features:</p><ul><li>cluster support (of course)</li><li>tunable query time ranking</li><li>pluggable analyzers</li><li>fuzzy queries (Levenstein distance)</li><li>Jaccard similarity</li><li>highlighting</li></ul><p>If you are already working on a project in which other analyzers, rankers or queries are badly needed, please let us know via <a href="/service/mailto:hackers@arangodb.com">hackers@arangodb.com</a> or join #arangosearch <a href="https://slack.arangodb.com/">Community Slack channel</a>. We are looking forward to your feedback!</p><p><em>As previously published on </em><a href="https://www.arangodb.com/2018/01/milestone-arangodb-3-4-arangosearch-information-retrieval/"><em>ArangoDB</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=633456e4f2d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>