Skip to main content

Cloud

FAST Query Language

FQL stands for ‘FAST Query Language’ and it used to build very flexible and powerful queries of the index. Here is a simple FQL example in which the word ‘Examen’ is searched within the document field named ‘passage’:

passage:string(“Examen”)

AND/OR: in these examples, the ‘and’ / ‘or’ operators indicate that they are applied to the query terms ‘Red’ and ‘Car’:

passage:and(“Red”, “Car”)

passage:or(“Red”, “Car”)

In the previous examples, a single non-scope field was used in the field specification. You could also use FAST’s composite field which consists of a set of fields:

<composite-field name=”customcompositefield” >

<field-ref name=”passage” level=”1″ >

<field-ref name=”title” level=”2″ />

</composite-field>

Now FQL can be used to easily query a composite field using the field specification such as:

customcompositefield: and(“Red”, “Car”)

NOT: this operator used to find results that don’t match the operand:

passage:not(“2009”) <- only returns documents that do not match the operand ‘2009’

COUNT: this operator returns the number of times the operand is found.

passage:count(“Car”)

You could extend COUNT to something like:

passage:count(“Car”) > 10 <- shows documents in which ‘car’ appears more than 10 times.

Tags

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

PointBridge Blogs

More from this Author

Follow Us