Menu

Boolean queries in Galago

Galago
2018-01-16
2018-01-17
  • Anton van der Vegt

    How do i create boolean queries in Galago. For example:

    Return all documents where the title field contains the term "hello world"

    I looked through the documentation, but couldn't find anything specific. I am guessing it is some kind of filter operator? If the documentation exists - happy to look there.
    thanks
    anton

     
  • Lemur Project

    Lemur Project - 2018-01-16

    I need to add more to documentation!

    I use the "#bool" and "#band" (Boolean AND) operations.

    For example, with an AP89 index that has only "Six Survivors" in a HEADLINE field, the query is:

    galago batch-search --index=ap89.idx --requested=5 \
                                            --query="#bool(#band(six.head survivors.head))"
    

    A #syn is essentially an OR but I think there is something more "booleanish" available.

     
  • Anton van der Vegt

    Great, many thanks.

    so to confirm, for your example, does this mean:

    a) only documents with the exact phrase "Six Survivors" in the head field will be retrieved or
    b) only documents with both the terms "six" and "survivors" in the head field will appear ?

    thanks

    Anton

     
  • Lemur Project

    Lemur Project - 2018-01-17

    Only documents with the terms six AND survivors in the HEAD field are retrieved.

    If you want a phrase, you'd have to add a proximity or window operator for the two terms.

     

Log in to post a comment.