Federated Desktop and File Server Search with libferris
The libferris project has two major goals: mounting anything as a filesystem and providing index and search for anything it can mount. Using libferris to provide desktop search was described in my February 2005 article, “Filesystem Indexing with libferris” in Linux Journal. The indexing capabilities of libferris have grown since then. One new feature is to allow a group of indexes to function logically as a single, “federated” index. This lets you have an index for your file server, another for your man pages and a third for your personal documents. You then can run queries against all three as though they were a single index.
libferris handles its index and search using a plugin system. There currently are index plugins for db4, PostgreSQL, ODBC, Redland (RDF), Xapian, Beagle, Yahoo, LDAP, CLucene, Lucene and external processes. The indexes that form a federated index in libferris can use any mixture of those index plugins.
libferris has two different types of indexing plugins: full text and metadata. The metadata interface of libferris is based on the Extended Attribute (EA) kernel interface. Having two index plugin types allows the index plugin to organize data on disk to best support queries.
A full-text index normally will maintain for each word from a human language a list of which files contain that word and a statistical measure of how important that word seems to the document. The statistic allows documents that are “more relevant” to be presented first in the results. Such statistics normally relate to how large a file is, how often the word appears in that file and how rare the occurrence of that word is across all indexed files.
A metadata index has to associate a docid with a keyword and value. For example, /tmp/foo has a size of 145. The metadata index has to be able to process queries, such as size>=4kb && modified this week, and efficiently return the docids for files that satisfy this query. The main difference between metadata and full-text index plugins is that the metadata queries contain value comparisons on metadata (for example, mtime>=last week), whereas full-text queries generally are more interested in the presence of a word in a file.
From an index user's point of view, having this distinction is an annoying implementation artifact. To get around this, a full-text index can be linked to a metadata index using the feaindex-attach-fulltext-index command. Queries combining both metadata and full-text searching can then be executed on the metadata index. It is convenient to think of the metadata index as owning the full-text index.
The metadata query format reserves any metadata names starting with ferris- to have special meaning. A metadata name ferris-fulltext-query or ferris-ftx will execute its query value as a full-text query on the linked full-text index. Shown in Listing 1 is a metadata query seeking all files under a given size with the two given words in them. If instead of combining the results with &, we used the or operator | in the query, any results matching either subquery would be returned. To query a full-text index, the findexquery command is used. Combined metadata and full-text indexes are queried using the metadata query command feaindexquery.
Listing 1. A Combined Full-Text and Metadata Index Query
$ feaindexquery \ '(&(size<=250k)(ferris-ftx==alice wonderland))'
The above discussion of docids becomes relevant when combining two types of index plugins like this. The greatest efficiency can be gained when both the metadata and full-text index plugins are using the same storage—for example, the PostgreSQL (metadata) and TSearch2 (full-text) plugins using the same underlying PostgreSQL database, or both indexes using the same CLucene storage.
The efficiency is obtained because each URL has the same docid. Using the PostgreSQL combination as an example, to resolve the query from Listing 1, the full-text subquery will be run against the TSearch2 plugin obtaining a set of matching docids. The set of docids matching the size query is obtained, and the set intersection of the size and full-text query results is returned. This final step can be done only if it is known that both the metadata and full-text index have the same docid for the same URL. Otherwise, the docids from the full-text query have to be converted into URL strings and then into the docids of the metadata index first.
When using a metadata and full-text plugin together like this, make sure that each file is added to both indexes.
Each metadata index plugin will automatically detect if it is safe to use the docids of the full-text index directly that is linked to it.
The federation index plugin is a metadata plugin. A federation is formed using many metadata indexes with one nominated as the writable index. As each metadata index can own a full-text index, this allows federations of an arbitrary number of full-text and metadata indexes. Each index in the federation can be updated independently of the federation.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Designing Electronics with Linux
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Reply to comment | Linux Journal
54 min 51 sec ago - Dynamic DNS
1 hour 28 min ago - Reply to comment | Linux Journal
2 hours 27 min ago - Reply to comment | Linux Journal
3 hours 17 min ago - Not free anymore
7 hours 19 min ago - Great
11 hours 6 min ago - Reply to comment | Linux Journal
11 hours 14 min ago - Understanding the Linux Kernel
13 hours 29 min ago - General
15 hours 59 min ago - Kernel Problem
1 day 2 hours ago




Comments
Airline
Good morning. I am free of all prejudice. I hate everyone equally.
I am from Switzerland and too bad know English, tell me right I wrote the following sentence: "Com your starting point for cheap airline tickets."
Thanks :-D. Emanuele.
Federated Desktop
Nice article.....Thanks for sharing
Thanks
Thanks for sharing the knowledge