LINQ to Lucene

来自:http://linqtolucene.codeplex.com/ 

uesday, 13 November 2007
This release provides a real focus on the querying abilities of the LINQ to Lucene project and is the first real 'working release', converting LINQ statements to Lucene queries with deferred query execution and object creation or projection. It culminates the majority of the required querying features for LINQ that Lucene provides natively. 

  Lucene Syntax LINQ to Lucene
Terms & Phrases "test" or "hello dolly" c.Match("test") or c.Match("hello dolly")
Fields title:"The Right way" andtext:go c.Title == "The Right way" or c.Text == "go"
WildCard amb?r c.ContactName.Match("amb?r")
Prefix amber* c.ContactName.StartsWith("amber")
Fuzzy roam~ or roam~0.8 c.ContactName.Like("roam") orc.ContactName.Like("roam", 0.8)
Proximity "jakarta apache"~10 c.ContactName.Like("jakarta apache", 10)
Inclusive Range mod_date:[20020101 TO 20030101] c.ModifiedDate.Includes("20020101", "20030101")
Exclusive Range title:{Aida TO Carmen} c.Title.Between("Aida", "Carmen")
Boosting jakarta^4 apache c.Title.Match("jakarta".Boost(4), apache)
Boolean Or "jakarta apache" OR jakarta where c.Match("jakarta apache") || c.Match("jakarta")
Boolean And "jakarta apache" AND "Apache Lucene" where c.Match("jakarta apache") && c.Match("Apache Lucene")
Boolean Not "jakarta apache" NOT "Apache Lucene" where c.Match("jakarta apache") && !c.Match("Apache Lucene")
Required +jakarta lucene c.Title.Match("jakarta".Require(), "lucene")
Grouping (jakarta OR apache) AND website where (c.Title == "jakarta" || c.Title == "apache") && (c.Title == "website")
Native Syntax ie. title:{+return +"pink panther") c.Search("title:(return +\"pink panther\"")

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值