Last day just after I hit the “submit” button a doubt came into my mind: “did I say everything ?”
Well, the answer is “No!”
In fact I forgot to tell you one of the most important things: how to have some fun with Strigi and Xesam!

Actually the only way to perform XesamQueryLanguage queries with Strigi is through the strigicmd program.

Strigicmd is a command-line tool shipped with Strigi. It can perform different actions like:

  • create Strigi indexes
  • remove items from index
  • list all files contained into an index
  • retrieve informations associated to an indexed file
  • update the contents of your index
  • query the index
  • perform a query using XesamQueryLanguage

So, if you want to try the new Xesam support you’ve just to use strigicmd with the xesamquery option.
The command syntax is:
strigicmd xesamquery -t backend -d indexdir [-u xesam_user_language_file] [-q xesam_query_language_file]
As you can expect you’ve to save your Xesam query to file and point strigicmd to it.

This is a really small step-by-step guide:

  1. Create a new Strigi index (in this case I’ll index all irc logs):
    strigicmd create -t clucene -d temp/ logs/
  2. Create a simple file containing your Xesam query. You can find some example query on Xesam site or inside strigi tarball (complete path: strigi/src/streamanalyzer/xesam/testqueries/).
    This is a stupid and easy query:

    <request>
    
    <query>
    
    <or>
    
    <equals>
    
    <string casesensitive="true">Oever</string>
    
    </equals>
    
    <contains>
    
    <string casesensitive="false">jos</string>
    
    </contains>
    
    </or>
    
    </query>
    
    </request>
  3. Perform the search, just type:
    strigicmd xesamquery -t clucene -d temp/ -q ~/irc_oever.xml
  4. Enjoy the search results ;)

Remember that XesamUserLanguage query language isn’t yet supported.

Tags: , , ,
2 Responses to “How to have some fun with Strigi and Xesam queries”
  1. Bille says:

    I tried some xesam queries just now on the KDE help docbook files, and it works – good job!

  2.  
Leave a Reply