自己封装的ajax类
作者:admin 日期:2008-08-27
C#中获取应用程序路径的方法(集合)
作者:admin 日期:2008-08-20
string str1 =Process.GetCurrentProcess().MainModule.FileName;//可获得当前执行的exe的文件名。
string str2=Environment.CurrentDirectory;//获取和设置当前目录(即该进程从中启动的目录)的完全限定路径。
//备注 按照定义,如果该进程在本地或网络驱动器的根目录中启动,则此属性的值为驱动器名称后跟一个尾部反斜杠(如“C:\”)。如果该进程在子目录中启 动,则此属性的值为不带尾部反斜杠的驱动器和子目录路径(如“C:\mySubDirectory”)。
string str3=Directory.GetCurrentDirectory();//获取应用程序的当前工作目录。
string str4=AppDomain.CurrentDomain.BaseDirectory;//获取基目录,它由程序集冲突解决程序用来探测程序集。
string str2=Environment.CurrentDirectory;//获取和设置当前目录(即该进程从中启动的目录)的完全限定路径。
//备注 按照定义,如果该进程在本地或网络驱动器的根目录中启动,则此属性的值为驱动器名称后跟一个尾部反斜杠(如“C:\”)。如果该进程在子目录中启 动,则此属性的值为不带尾部反斜杠的驱动器和子目录路径(如“C:\mySubDirectory”)。
string str3=Directory.GetCurrentDirectory();//获取应用程序的当前工作目录。
string str4=AppDomain.CurrentDomain.BaseDirectory;//获取基目录,它由程序集冲突解决程序用来探测程序集。
使用lucene做分组统计
作者:admin 日期:2008-08-18
这段时间考虑lucene的分组统计问题,在网上查了不少文档,都没有给出效率比较高的解决方案。可以使用HitCollector对每个查询出来的document进行遍历,读取要分组的字段进行统计,但这样效率太低了。以下是lucene中对HitCollector的说明:
Note: This is called in an inner search loop. For good search performance, implementations of this method should not call Searcher.doc(int) or IndexReader.document(int) on every document number encountered. Doing so can slow searches by an order of magnitude or more.
所以现在要考虑的是不调用Searcher.doc(int) or IndexReader.document(int)这两个方法,就能获得要分组字段的值。由于lucene支持排序,是否可以将分组字段作为排序字段,然后直接读取出来进行分组呢?查询Lucene的javadoc文档,IndexSearcher提供了这个api
Note: This is called in an inner search loop. For good search performance, implementations of this method should not call Searcher.doc(int) or IndexReader.document(int) on every document number encountered. Doing so can slow searches by an order of magnitude or more.
所以现在要考虑的是不调用Searcher.doc(int) or IndexReader.document(int)这两个方法,就能获得要分组字段的值。由于lucene支持排序,是否可以将分组字段作为排序字段,然后直接读取出来进行分组呢?查询Lucene的javadoc文档,IndexSearcher提供了这个api
Tags: lucene
把SQL SERVER里表里的数据导出成为insert into 脚本
作者:admin 日期:2008-08-16
Lucene学习笔记_搜索之IndexSearch使用
作者:admin 日期:2008-08-14
Lucene.net多字段(Fields)、多索引目录(IndexSearcher)搜索
作者:admin 日期:2008-08-14
Lucene.net是目前在.net环境中被普遍使用的全文索引的开源项目,这次在项目的开发中也使用它进行全文索引。
在开发过程中碰到一些小问题就是对多字段和多索引目录进行搜索。
1、多字段搜索就是同时要一个以上的字段中的内容进行比较搜索,类似概念在SQL中就是select * from Table where a like '%query%' or b like '%query%'。
Lucene.net中的单个字段查询大家都比较熟悉,这里对字段content进行搜索
在开发过程中碰到一些小问题就是对多字段和多索引目录进行搜索。
1、多字段搜索就是同时要一个以上的字段中的内容进行比较搜索,类似概念在SQL中就是select * from Table where a like '%query%' or b like '%query%'。
Lucene.net中的单个字段查询大家都比较熟悉,这里对字段content进行搜索
Tags: lucene.net






