In general, the API has changed a lot on the querying part, such that the operator support has been altered to be more integrated with the expression tree.

Some sample queries that you can now do are:
var query = from c in index.Customers
            where c.ContactName.Like("maria", 0.7) && !c.CompanyName == "moose box";

OUTPUT:
((ContactName:maria~0.7 AND -(CompanyName:"moose box")))

var query = from c in index.Customers
            where c.Like("amber") || c.CompanyName.Between("a", "d")

OUTPUT:
((amber) (CompanyName:{a TO d}))

Notice how in the second query, we can query against either a member of the type or the type itself. When querying against the type itself, it creates the query syntax without the field prefix...
c.Like("amber") --> (amber~)
c.CompanyName.Like("amber") --> (CompanyName:amber~)

The operator-methods are:
Like (for fuzzy, proximity)
Match (for wildcard searching)
Between (for exclusive range)
Include (for inclusive range)

You can use where multiple times to create groupings:
var query = from c in index.Customers
            where c.Like("amber") || c.CompanyName.Between("a", "d")
            where !c.CustomerId == "Jason"

OUTPUT:
((amber) (CompanyName:{a TO d})) (CustomerId:Jason)


Note that at the moment, while the AND operator is supported inside of groups, it is not supported between groups yet, making the default between groups OR.

Last edited Apr 2, 2012 at 5:41 PM by stemarie, version 1

Comments

No comments yet.