i have site where i need to develop site search functionality. the
data may reside in database table or may in aspx page as static word. i
search google and found that lucene.net may be appropriate for the site
search functionality. but i never use lucene.net
so i dont know how to create lucene.net index file. i want to develop 2
utility in my site like
1) one for create & update index file reading data from database table & physical aspx file.
2) utility which search multiple single or multiple keyword against index file.
i found a bit of code snippet which i just do not understand
string indexFileLocation = @"C:\Index";
string stopWordsLocation = @"C:\Stopwords.txt";
var directory = FSDirectory.Open(new DirectoryInfo(indexFileLocation));
Analyzer analyzer = new StandardAnalyzer(
Lucene.Net.Util.Version.LUCENE_29, new FileInfo(stopWordsLocation));
what is Lucene.Net.Util.Version.LUCENE_29 what is stopWordsLocation how data need to store in Stopwords.txt
but have no concept to develop the above 2 utility.
here is my tables schema which i want to search by lucene.net
i like to create index just extract data from all the fields from the
above 3 table and also need to extract static data from aspx page and
store in lucene index file for search later.
CREATE TABLE [Website_Content]
(
[PageTitle] [nvarchar](512) NULL,
[Description] [nvarchar](512) NULL,
[Keywords] [nvarchar](512) NULL,
[Content] [ntext] NULL
)
CREATE TABLE [Products]
(
[ProductId] [int] IDENTITY(1,1) NOT NULL,
[CategoryId] [int] NOT NULL,
[Ref1] [varchar](32) NULL ,
[Ref2] [varchar](32) NULL,
[Title] [varchar](128) NULL,
[Year] [varchar](10) NULL,
[Description] [ntext] NULL,
[IsOwnUnitRebuild] [bit] NOT NULL,
[PriceEx] [money] NOT NULL,
[Surcharge] [money] NOT NULL,
[Availability] [nvarchar](16) NULL,
[IsSellableOnline] [bit] NOT NULL,
[DetailedProductID] [int] NOT NULL,
[Siemens] [bit] NULL,
[Features] [ntext] NULL,
[ProductInfo] [ntext] NULL,
[BoxContent] [ntext] NULL,
[Picture1] [image] NULL,
[Picture2] [image] NULL,
[Picture3] [image] NULL,
[Picture4] [image] NULL,
[VehicleApplication] [nvarchar](1024) NULL,
[FAQ] [ntext] NULL,
[EbayLink] [nvarchar](256) NULL,
[PriceExUS] [money] NULL,
[Country] [varchar](50) NULL,
[PriceOUR] [money] NULL,
[PriceOURUS] [money] NULL,
[PriceEUR] [money] NULL ,
[PriceOUREUR] [money] NULL
)
CREATE TABLE [DetailedProducts](
[ProductId] [int] IDENTITY(1,1) NOT NULL,
[Category] [int] NULL,
[OERef] [nvarchar](32) NULL,
[ManufacturerRef] [nvarchar](32) NULL,
[Title] [nvarchar](64) NULL,
[Year] [nvarchar](32) NULL,
[PriceEx] [money] NULL,
[Options] [nvarchar](64) NULL,
[IsOwnUnitRebuilt] [bit] NULL,
[Surcharge] [money] NULL,
[Availability] [nvarchar](32) NULL,
[IsSellableOnline] [bit] NULL,
[Features] [ntext] NULL,
[ProductInfo] [ntext] NULL,
[BoxContent] [ntext] NULL,
[Picture1] [image] NULL,
[Picture2] [image] NULL,
[Picture3] [image] NULL,
[Picture4] [image] NULL,
[VehicleApplication] [nvarchar](1024) NULL,
[FAQ] [ntext] NULL,
[EbayLink] [nvarchar](256) NULL,
[PriceExUS] [money] NULL,
[Country] [varchar](50) NULL,
[PriceOUR] [money] NULL,
[PriceOURUS] [money] NULL,
[PriceEUR] [money] NULL ,
[PriceOUREUR] [money] NULL
)
so please guide me how search my DB and as well as aspx files with
lucene.net....i will be glad if some one discuss here with bit of sample
code. thanks