LINQ to Lucene

来源:互联网 发布:c数组删除指定元素 编辑:程序博客网 时间:2024/05/24 06:49

来自: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 SyntaxLINQ to LuceneTerms & Phrases"test" or "hello dolly"c.Match("test") or c.Match("hello dolly")Fieldstitle:"The Right way" andtext:goc.Title == "The Right way" or c.Text == "go"WildCardamb?rc.ContactName.Match("amb?r")Prefixamber*c.ContactName.StartsWith("amber")Fuzzyroam~ or roam~0.8c.ContactName.Like("roam") orc.ContactName.Like("roam", 0.8)Proximity"jakarta apache"~10c.ContactName.Like("jakarta apache", 10)Inclusive Rangemod_date:[20020101 TO 20030101]c.ModifiedDate.Includes("20020101", "20030101")Exclusive Rangetitle:{Aida TO Carmen}c.Title.Between("Aida", "Carmen")Boostingjakarta^4 apachec.Title.Match("jakarta".Boost(4), apache)Boolean Or"jakarta apache" OR jakartawhere 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 lucenec.Title.Match("jakarta".Require(), "lucene")Grouping(jakarta OR apache) AND websitewhere (c.Title == "jakarta" || c.Title == "apache") && (c.Title == "website")Native Syntaxie. title:{+return +"pink panther")c.Search("title:(return +\"pink panther\"")