Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@apache.org Received: (qmail 39513 invoked from network); 7 Sep 2002 16:01:23 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 Sep 2002 16:01:23 -0000 Received: (qmail 24813 invoked by uid 97); 7 Sep 2002 16:01:56 -0000 Delivered-To: qmlist-jakarta-archive-lucene-dev@jakarta.apache.org Received: (qmail 24762 invoked by uid 97); 7 Sep 2002 16:01:55 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 24750 invoked by uid 98); 7 Sep 2002 16:01:55 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <20020907160119.3036.qmail@web12701.mail.yahoo.com> Date: Sat, 7 Sep 2002 09:01:19 -0700 (PDT) From: Otis Gospodnetic Subject: Re: Lucene introduction in Chinese To: Lucene Developers List In-Reply-To: <20020810184009.66527.qmail@web13802.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Thank you for this. I think we should add this to the contribution page or some other place on the Lucene site (I'll take a look in a bit). I would like to just add a link to it. Note: the link to Lucene's home page at the bottom of the page is wrong: http://jakarta.apache.org/Lucene/ should be http://jakarta.apache.org/lucene/ Thanks, Otis --- "Che, Dong" wrote: > http://www.chedong.com/tech/lucene.html > > ��Ӧ���м���ȫ�ļ������� > ��������JAVA��ȫ����������Lucene��� > > ���ߣ� ���� chedong@bigfoot.com > > �����£�2002-08-11 02:08:46 > > ��Ȩ��������������ת�أ�ת��ʱ����ر���ԭʼ������������Ϣ > > �ؼ��ʣ�Lucene full-text search engine Chinese word > segment > > ժҪ��Lucene��һ������JAVA��ȫ���������߰��� > > ����JAVA��ȫ����������Lucene��飺�������ߺ�Lucene����ʷ > > ȫ�ļ�����ʵ�֣�Lueneȫ�����������ݿ������ıȽ� > �����зִʻ��Ƽ�飺���ڴʿ���Զ��зִ��㷨�ıȽ� > ����İ�װ��ʹ�ü�飺ϵͳ�ṹ���ܺ���ʾ > Hacking > Lucene���򻯵IJ�ѯ��������ɾ����ʵ�֣����Ƶ�����Ӧ�ýӿڵ���չ > > ��Lucene���ǻ�����ѧ��ʲô > ����JAVA��ȫ������/�������桪��Lucene > > Lucene����һ��������ȫ������Ӧ�ã�������һ����JAVAд��ȫ���������湤�߰��������Է����Ƕ�뵽����Ӧ����ʵ�����Ӧ�õ�ȫ������/�������ܡ� > > Lucene�����ߣ�Lucene�Ĺ�����Doug > Cutting��һλ����ȫ������/����ר�ң�������V-Twin��������(Apple��Copland����ϵͳ�ijɾ�֮һ)����Ҫ�����ߣ�����Excite���θ߼�ϵͳ�ܹ����ʦ��Ŀǰ������һЩINTERNET�ײ�ܹ����о��������׳���Lucene��Ŀ����Ϊ������С��Ӧ�ó������ȫ�ļ������ܡ� > > Lucene�ķ�չ���̣����ȷ����������Լ���www.Lucene.com������������SOURCEFORGE��2001����׳�ΪAPACHE�����jakarta��һ������Ŀ��http://jakarta.apache.org/Lucene/ > > ����Lucene��Ӧ�ã� > �Ѿ��кܶ�JAVA��Ŀ��ʹ����Lucene��Ϊ���̨��ȫ���������棬�Ƚ��������У� > > JIVE��WEB��̳ϵͳ�� > Eyebrows���ʼ��б�HTML�鵵/���/��ѯϵͳ�����ĵ���Ҫ�ο��ĵ���The > Lucene search engine: Powerful, flexible, and > free�����߾���EyeBrowsϵͳ����Ҫ������֮һ����EyeBrows�Ѿ���ΪĿǰAPACHE��Ŀ����Ҫ�ʼ��б��鵵ϵͳ�� > > Cocoon: ����XML��web������ܣ�ȫ�ļ�������ʹ����LUCENE > > ���������û���˵������ĵ����������Ƿ�֧�����ĵ�ȫ�ļ�������ͨ���������Lucene�Ľṹ�Ľ��ܣ�����˽⵽����Lucene���üܹ���ƣ�ֻ��һЩ�򵥵Ľӿ���չ����ʵ�ֶ����ļ�����֧�֡� > > ȫ�ļ�����ʵ�ֻ��� > > Lucene��API�ӿ���ƵıȽ�ͨ�ã���������ṹ���������ݿ�ı�==>��¼==>�ֶΣ����Ժܶഫͳ��Ӧ�õ��ļ������ݿ�ȶ����ԱȽϷ����ӳ�䵽Lucene�Ĵ洢�ṹ/�ӿ��С������Ͽ��������Ȱ�Lucene����һ��֧��ȫ�����������ݿ�ϵͳ�� > > �Ƚ�һ��Lucene�����ݿ⣺ > > Lucene ���ݿ� > ��������Դ��doc(field1,field2...) > doc(field1,field2...) > \ indexer / > _____________ > | Lucene Index| > -------------- > / searcher \ > ��������Hits(doc(field1,field2) doc(field1...)) > ��������Դ��record(field1,field2...) record(field1..) > \ SQL: insert/ > _____________ > | DB Index | > ------------- > / SQL: select \ > ��������results(record(field1,field2..) > record(field1...)) > Document��һ����Ҫ���������ġ���Ԫ�� > һ��Document�ɶ���ֶ���� Record����¼����������ֶ� > Field���ֶ� Field���ֶ� > Hits����ѯ���������ƥ���Document��� > RecordSet����ѯ��������ɶ��Record��� > > ȫ�ļ��� �� like "%keyword%" > > ͨ���ȽϺ���鼮���泣�����ؼ��������������磺������12, > 34ҳ�� �Ϻ���3, > 77ҳ�����������ܹ��������߱ȽϿ���ҵ�������ݵ�ҳ�롣�����ݿ������ܹ������߲�ѯ���ٶ�ԭ��Ҳ��һ��������һ��ͨ���������������ҵ��ٶ�Ҫ��һҳһҳ�ط����ݸ߶��ٱ�����������֮����Ч�ʸߣ�����һ��ԭ���������ź���ġ����ڼ���ϵͳ��˵������һ���������⡣ > > �������ݿ���������Ϊȫ��������Ƶģ���ˣ�ʹ��like > "%keyword%"ʱ�����ݿ������Dz������õģ���ʹ��like��ѯʱ�����������ֱ��������һҳҳ����ı��������ˣ����Զ��ں���ģ����ѯ�����ݿ������˵��LIKE�����ܵ�Σ���Ǽ���ġ��������Ҫ�Զ���ؼ��ʽ���ģ��ƥ�䣺like > "%keyword1%" and like "%keyword2%" > ...��Ч��Ҳ�Ϳ����֪�ˡ� > > ���Խ���һ����Ч����ϵͳ�Ĺؼ��ǽ���һ�������ڿƼ�����һ���ķ����������ƣ�������Դ�������ƪ���£�����˳��洢��ͬʱ��������һ���ź���Ĺؼ����б������ڴ洢�ؼ���==>����ӳ���ϵ������������ӳ���ϵ������[�ؼ���==>���ֹؼ��ʵ����±�ţ����ִ�������������λ�ã���ʼƫ����������ƫ������������Ƶ��]���������̾��ǰ�ģ����ѯ��ɶ���������������ľ�ȷ��ѯ���߼���ϵĹ��̡��Ӷ��������˶�ؼ��ʲ�ѯ��Ч�ʣ����ԣ�ȫ�ļ��������ᵽ�����һ���������⡣ > > �ɴ˿��Կ���ģ����ѯ������ݿ�ľ�ȷ��ѯ��һ���dz���ȷ�������⣬��Ҳ�Ǵ󲿷����ݿ��ȫ�ļ���֧�����޵�ԭ��Lucene����ĵ�������ͨ������������ṹʵ���˴�ͳ���ݿⲻ�ó���ȫ���������ƣ����ṩ����չ�ӿڣ��Է�����Բ�ͬӦ�õĶ��ơ� > > ����ͨ��һ�±���Ա�һ�����ݿ��ģ����ѯ�� > > �� Luceneȫ���������� ���ݿ� > ���� ������Դ�е����ݶ�ͨ��ȫ������һһ������������ > ����LIKE > ��ѯ��˵�����ݴ�ͳ�������Ǹ����ò��ϵġ�������Ҫ���������¼����GREPʽ��ģ��ƥ�䣬���������������ٶ�Ҫ�ж�����������½��� > > ƥ��Ч�� > ͨ����Ԫ(term)����ƥ�䣬ͨ�����Է����ӿڵ�ʵ�֣�����ʵ�ֶ����ĵȷ�Ӣ���֧�֡� > ʹ�ã�like "%net%" ���netherlandsҲƥ������� > ����ؼ��ʵ�ģ��ƥ�䣺ʹ��like > "%com%net%"���Ͳ���ƥ�����ߵ���xxx.net..xxx.com > ƥ��� > ��ƥ����㷨����ƥ��̶ȣ����ƶȣ��ȽϸߵĽ������ǰ�档 > û��ƥ��̶ȵĿ��ƣ������м�¼��net����5�ʺͳ���1�εģ������һ���ġ� > > ������ > ͨ���ر���㷨������ƥ�����ߵ�ͷ100����������������ǻ���ʽ��С������ȡ�ġ� > �������еĽ��������ƥ����Ŀ�dz����ʱ�򣨱�������������Ҫ�������ڴ�����Щ��ʱ������� > > �ɶ����� > ͨ����ͬ�����Է����ӿ�ʵ�֣����Է���Ķ��Ƴ�����Ӧ����Ҫ���������򣨰��������ĵ�֧�֣� > û�нӿڻ�ӿڸ��ӣ��޷����� > ���� > �߸��ص�ģ����ѯӦ�ã���Ҫ�����ģ����ѯ�Ĺ����������������Ƚϴ� > ʹ���ʵͣ�ģ��ƥ�����򵥻�����Ҫģ����ѯ���������� > > Lucene�Ĵ���֮���� > > �󲿷ֵ����������ݿ⣩���涼����B���ṹ��ά�������������ĸ��»ᵼ�´�����IO������Lucene��ʵ���У��Դ���΢�����Ľ�������ά��һ�������ļ�����������չ������ʱ�򲻶ϴ����µ������ļ���Ȼ���ڵİ���Щ�µ�С�����ļ��ϲ���ԭ�ȵĴ������У���Բ�ͬ�ĸ��²��ԣ����εĴ�С���Ե������������ڲ�Ӱ�������Ч�ʵ�ǰ���£������������Ч�ʡ� > > Lucene������һЩȫ�ļ���ϵͳ/Ӧ�õıȽϣ� > > �� Lucene ������Դȫ�ļ���ϵͳ > ������������������ > ���Խ�������������(Append)�����Զ��ڴ������ݽ����������������ҽӿ���������Ż�����������С���������������� > �ܶ�ϵͳֻ֧����������������ʱ����Դ��һ������Ҳ��Ҫ�ؽ������� > > ����Դ > Luceneû�ж�����������Դ������һ���ĵ��Ľṹ����˿��Էdz�������Ӧ����Ӧ�ã�ֻҪǰ���к��ʵ�ת����������Դת������Ӧ�ṹ���� > �ܶ�ϵͳֻ�����ҳ��ȱ��������ʽ�ĵ�������ԡ� > ���ݷָ� > Lucene���ĵ����ɶ���ֶ���ɵģ��������Կ�����Щ�ֶ���Ҫ������ > ��Щ�ֶβ���Ҫ��������һ���������ֶ�Ҳ�֣� > ��Ҫ���зִʵ����������磺���⣬���������ֶ� > ����Ҫ���зִʵ����������磺����/�����ֶ� > ȱ��ͨ���ԣ��������ĵ����������� > ���Է��� ͨ�����Է������IJ�ͬ��չʵ�֣� > ���Թ��˵�����Ҫ�Ĵʣ�an the of �ȣ� > �����﷨��������jumps jumped > jumper������jump��������/���� > ��Ӣ��֧�֣����������ԣ����������Ե�����֧�� > ȱ��ͨ�ýӿ�ʵ�� > ��ѯ���� > ͨ����ѯ�����ӿڵ�ʵ�֣����Զ����Լ��IJ�ѯ�﷨���� > ���磺 ����ؼ���֮��� + - and or��ϵ�� �� > �������� �ܹ�֧�ֶ��û���ʹ�� �� > > �� > > �����������Եĵ��зִ�����(Word Segment) > > ����������˵��ȫ���������Ȼ�Ҫ���һ�����Է��������⣬����Ӣ����˵������е���֮������Ȼͨ���ո�ֿ��ģ����������Ե����պ�������е�����һ���ְ�һ�������У�����Ҫ������а����ʡ����������Ļ������������зֳ�������һ���ܴ�����⡣ > > ���ȣ��϶������õ����ַ���(si-gram)Ϊ������Ԫ������顰�Ϻ���ʱ�������ú��С����ϡ�Ҳƥ�䡣 > > ��һ�仰���������찲�š����������ΰ������ĵ�����ϰ�߽����з��أ� > ������ �찲�š� ���ǡ��� �� �찲 > �š����ü�����ܹ���������ϰ�߽����з֣�������Ҫ������һ���ȽϷḻ�Ĵʿ���ܹ��Ƚ�׼ȷ��ʶ�������еĵ��ʡ� > > ����һ������İ취�Dz����Զ��з��㷨�������ʰ���2Ԫ�﷨(bigram)��ʽ�зֳ��������磺 > "�����찲��" ==> "���� ���� �찲 ����"�� > > �������ڲ�ѯ��ʱ�������Dz�ѯ"����" > ���Dz�ѯ"�찲��"������ѯ���鰴ͬ���Ĺ�������з֣�"����"��"�찲 > ����"������ؼ���֮�䰴��"and"�Ĺ�ϵ��ϣ�ͬ���ܹ���ȷ��ӳ�䵽��Ӧ�������С����ַ�ʽ���������������ԣ����ģ����Ķ���ͨ�õġ� > > �����Զ��зֵ�����ŵ���û�дʱ�ά���ɱ���ʵ�ּ򵥣�ȱ��������Ч�ʵͣ���������С��Ӧ����˵������2Ԫ�﷨���зֻ��ǹ��õġ� > > �Զ��з� �ʱ��з� > ʵ�� ʵ�ַdz��� ʵ�ָ��� > ��ѯ �����˲�ѯ�����ĸ��ӳ̶ȣ� > ����ʵ�ֱȽϸ��ӵIJ�ѯ�﷨���� > �洢Ч�� �������������������ԭ��һ���� > ����Ч�ʸߣ�Ϊԭ�Ĵ�С��30������ > ά���ɱ� �޴ʱ�ά���ɱ� > �ʱ�ά���ɱ��dz��ߣ����պ���������Ҫ�ֱ�ά���� > ����Ҫ������Ƶͳ�Ƶ����� > �������� Ƕ��ʽϵͳ�����л�����Դ���� > �ֲ�ʽϵͳ���޴ʱ�ͬ������ > �����Ի������޴ʱ�ά���ɱ� > �Բ�ѯ�ʹ洢Ч��Ҫ��ߵ�רҵ�������� > > > Ŀǰ�Ƚϴ��������������Է����㷨һ���ǻ�������2�����ƵĽ�ϡ��������ĵ����Է����㷨����ҿ�����GOOGLE��ؼ���"word > segment search"���ҵ�������ص����ϡ� > > ��װ��ʹ�� > > ���أ�http://jakarta.apache.org/Lucene/ > > ע�⣺Lucene�е�һЩ�Ƚϸ��ӵĴʷ���������JavaCC���ɵģ�JavaCC��Java > Compiler > Compiler����JAVA�Ĵʷ������������������������Դ����������Ҫ�޸����е�QueryParser�������Լ��Ĵʷ�������������Ҫ��http://www.webgain.com/products/java_cc/����javacc�� > > lucene����ɽṹ�������ⲿӦ����˵����ģ��(index)�ͼ���ģ��(search)����Ҫ���ⲿӦ����� > > org.apache.Lucene.search/ ������� > org.apache.Lucene.index/ ������� > org.apache.Lucene.analysis/ ���Է����� > org.apache.Lucene.queryParser/ ��ѯ������ > org.apache.Lucene.document/ �洢�ṹ > org.apache.Lucene.store/ �ײ�IO/�洢�ṹ > org.apache.Lucene.util/ һЩ���õ����ݽṹ > > �򵥵�������ʾһ��Lucene��ʹ�÷����� > > �������̣��������ж�ȡ�ļ���������������ļ���·��(path�ֶ�)������(body�ֶ�)2���ֶν��д洢���������ݽ���ȫ�������������ĵ�λ��Document����ÿ��Document�����������ֶ�Field������Բ�ͬ���ֶ����Ժ�������������󣬶��ֶλ�����ѡ��ͬ������/�洢�ֶι����б����£� > ���� �д� ���� �洢 ��; > Field.Text(String name, String value) Yes Yes Yes > �зִ��������洢�����磺���⣬�����ֶ� > Field.Text(String name, Reader value) Yes Yes No > �зִ��������洢�����磺META��Ϣ�� > �����ڷ�����ʾ������Ҫ���м������� > Field.Keyword(String name, String value) No Yes Yes > ���з��������洢�����磺�����ֶ� > Field.UnIndexed(String name, String value) No No Yes > ��������ֻ�洢�����磺�ļ�·�� > Field.UnStored(String name, String value) Yes Yes No > ֻȫ�����������洢 > > public class IndexFiles { > //ʹ�÷�����: IndexFiles [�������Ŀ¼] > [�������ļ��б�] ... > public static void main(String[] args) throws > Exception { > String indexPath = args[0]; > IndexWriter writer; > > //��ָ�������Է���������һ���µ�д����������3��������ʾ�Ƿ�Ϊ׷�������� > writer = new IndexWriter(indexPath, new > SimpleAnalyzer(), false); > > for (int i=1; i System.out.println("Indexing file " + args[i]); > InputStream is = new FileInputStream(args[i]); > > //�������2���ֶ�Field��Document���� > //һ����·��path�ֶΣ���������ֻ�洢 > //һ��������body�ֶΣ�����ȫ�����������洢 > Document doc = new Document(); > doc.add(Field.UnIndexed("path", args[i])); > doc.add(Field.Text("body", (Reader) new > InputStreamReader(is))); > //���ĵ�д������ > writer.addDocument(doc); > is.close(); > }; > //�ر�д������ > writer.close(); > } > } > �� > ���������п��Կ����� > > ���Է������ṩ�˳���Ľӿڣ�������Է���(Analyser)�ǿ��Զ��Ƶģ���Ȼluceneȱʡ�ṩ��2���Ƚ�ͨ�õķ�����SimpleAnalyser��StandardAnalyser����2��������ȱʡ����֧�����ģ�����Ҫ������������Ե��зֹ�����Ҫ�޸���2���������� > > Lucene��û�й涨����Դ�ĸ�ʽ����ֻ�ṩ��һ��ͨ�õĽṹ��Document�������������������룬������������Դ�����ǣ����ݿ⣬WORD�ĵ���PDF�ĵ���HTML�ĵ�����ֻҪ�ܹ������Ӧ�Ľ���ת����������Դ����ɳ�Docuement���󼴿ɽ��������� > > ���ڴ�����������������������ͨ������IndexerWrite���ļ��ϲ�Ƶ�����ԣ�mergeFactor�����������������Ч�ʡ� > > �������̺ͽ����ʾ�� > > ����������ص���Hits���󣬿���ͨ�����ٷ���Document==>Field�е����ݡ� > > �������body�ֶν���ȫ�ļ��������Խ���ѯ�����path�ֶκ���Ӧ��ѯ��ƥ���(score)��ӡ������ > > public class Search { > public static void main(String[] args) throws > Exception { > String indexPath = args[0], queryString = args[1]; > //ָ������Ŀ¼�������� > Searcher searcher = new IndexSearcher(indexPath); > //��ѯ��������ʹ�ú�����ͬ�������Է����� > Query query = QueryParser.parse(queryString, > "body", > new SimpleAnalyzer()); > //�������ʹ��Hits�洢 > Hits hits = searcher.search(query); > //ͨ��hits���Է��ʵ���Ӧ�ֶε����ݺͲ�ѯ��ƥ��� > for (int i=0; i System.out.println(hits.doc(i).get("path") + "; > Score: " + > hits.score(i)); > }; > } > } > ���������������У����Է���������ѯ��������������������Searcher�������ṩ�˳���Ľӿڣ����Ը�����Ҫ���ж��ơ� > Hacking Lucene > > �򻯵IJ�ѯ������ > > ���˸о�lucene��ΪJAKARTA��Ŀ�󣬻�����̫���ʱ�����ڵ�����������QueryParser�������д󲿷��Ǵ�����û���������Ϥ�ģ�ĿǰLUCENE֧�ֵ��﷨�� > > Query ::= ( Clause )* > Clause ::= ["+", "-"] [ ":"] ( | "(" > Query ")" ) > > �м���߼�������and or + - && > ||�ȷ��ţ����һ���"�����ѯ"��������ĵ�ǰ׺/ģ����ѯ�ȣ����˸о�����һ��Ӧ����˵����Щ������һЩ������ʵ����ʵ�ܹ�ʵ��Ŀǰ������GOOGLE�IJ�ѯ������������ʵ���ڴ�����û���˵�Ѿ����ˡ����ԣ�Lucene���ڰ汾��QueryParser���DZȽϺõ�ѡ�� > > �����޸�ɾ��ָ����¼��Document�� > > Lucene�ṩ����������չ���ƣ���������Ķ�̬��չӦ����û������ģ���ָ����¼���޸�Ҳ�ƺ�ֻ��ͨ����¼��ɾ����Ȼ�����¼���ʵ�֡����ɾ��ָ���ļ�¼�أ�ɾ���ķ���Ҳ�ܼ򵥣�ֻ����Ҫ������ʱ��������Դ�еļ�¼IDר������������Ȼ������IndexReader.delete(Term > term)����ͨ�������¼IDɾ����Ӧ��Document�� > > ����ij���ֶ�ֵ�������� > > luceneȱʡ�ǰ����Լ�����ض��㷨��score�����н������ģ����ܹ����������ֶν��н��������һ����LUCENE�Ŀ����ʼ��б��о����ᵽ�����⣬�ܶ�ԭ�Ȼ������ݿ�Ӧ�ö���Ҫ���˻���ƥ��ȣ�score������������ܡ�����ȫ�ļ�����ԭ�����ǿ����˽⵽���κβ�������������������Ч�ʶ��ᵼ��Ч�ʷdz��ĵͣ�������������ֶε�������Ҫ�����������з��ʴ洢�ֶΣ��ٶȻش�󽵵ͣ���˷dz��Dz���ȡ�ġ� > > ������Ҳ��һ�����еĽ���������������������ܹ�Ӱ����������ֻ���������Ѿ��洢��docID��score��2�����������ԣ�����score�����������ʵ����ͨ��������ԴԤ���ź���Ȼ�����docID����������ʵ�֡������ͱ�������LUCENE���������Խ���ٴν�������������������з��ʲ��������е�ij���ֶ�ֵ�� > > ������Ҫ�޸ĵ���IndexSearcher�е�HitCollector���̣� > > ... > ��scorer.score(new HitCollector() { > private float minScore = 0.0f; > public final void collect(int doc, float score) { > if (score > 0.0f && // ignore zeroed buckets > (bits==null || bits.get(doc))) { // skip docs > not in bits > totalHits[0]++; > if (score >= minScore) { > /* > ԭ�ȣ�Lucene��docID����Ӧ��ƥ���score�����������б��У� > * hq.put(new ScoreDoc(doc, score)); // > update hit queue > * �����doc �� 1/doc ���� > score����ʵ���˸���docID˳�Ż����� > * > ��������Դ����ʱ�Ѿ�����ij���ֶ��ź����򣬶��������docID����Ҳ��ʵ���� > * > ���ij���ֶε�������������ʵ�ָ����ӵ�score��docID����ϡ� > */ > hq.put(new ScoreDoc(doc, (float) 1/doc > )); > if (hq.size() > nDocs) { // if hit queue > overfull > hq.pop(); // remove lowest in hit queue > minScore = ((ScoreDoc)hq.top()).score; // reset > minScore > } > } > } > } > }, reader.maxDoc()); > ��ͨ�õ���������ӿ� > > ��Ȼluceneû�ж���һ��ȷ���������ĵ���ʽ����Խ��Խ������뵽ʹ��һ����׼���м��ʽ��ΪLucene�����ݵ���ӿڣ�Ȼ���������ݣ�����PDFֻ��Ҫͨ��������ת���ɱ�׼���м��ʽ�Ϳ��Խ������������ˡ�����м��ʽ��Ҫ��XMLΪ��������ʵ���Ѿ�����4��5���� > > ����Դ: WORD PDF HTML > DB > \ | | > | / > XML�м��ʽ > | > Lucene INDEX > > �� > > ��Luceneѧ������ > > Luene��ȷ��һ����Զ�����Ƶĵ䷶ > > ���е����ⶼͨ��һ�����������������Ժ����չ�����ã������ͨ������ʵ�����ﵽ�Լ���Ŀ�ģ���������ģ�������Ҫ�� > > �򵥵�Ӧ�����Searcher, > Indexer�������õײ�һϵ�����Эͬ������������� > ���еĶ�������񶼷dz�רһ�������������̣�QueryParser��������ѯ���ת����һϵ�еľ�ȷ��ѯ�����(Query), > ͨ���ײ��������ȡ�ṹIndexReader���������Ķ�ȡ��������Ӧ�Ĵ����������������д��/����ȡ����ֻ����ǰ���ͷ100������ŵ�����������У�֪������Ҫ��ȡ������Ľ��ʱ���������еĹ���ģ��ԭ�ӻ��̶ȷdz��ߣ���˿���ͨ������ʵ�ֶ�����Ҫ�޸��������� > > ��������Ӧ�ýӿ���ƣ�Lucene���ṩ��һЩ�ʺϴ����Ӧ�õ����Է�����ʵ�֣�SimpleAnalyser, > StandardAnalyser������Ҳ�����û��ܹ��ܿ����ֵ���Ҫԭ��֮һ�� > > ��Щ�ŵ㶼�Ƿdz�ֵ�����Ժ�Ŀ�����ѧϰ����ġ���Ϊһ��ͨ�ù��߿⣬Lunece��ȷ��������Ҫ��ȫ�ļ�������Ƕ�뵽Ӧ���еĿ����ߺܶ�ı����� > > �� > > �� > > �ο����ϣ� > > Apache: Lucene Project > http://jakarta.apache.org/Lucene/ > Lucene�ʼ��б��鵵 > Lucene-dev@jakarta.apache.org > Lucene-user@jakarta.apache.org > > The Lucene search engine: Powerful, flexible, and free > http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-Lucene_p.html > > �������Ե��зִ� > > Lucene Tutorial > http://www.darksleep.com/puff/lucene/lucene.html > > Notes on distributed searching with Lucene > http://home.clara.net/markharwood/lucene/ > > �������湤�߽��� > http://searchtools.com/ > > ����������ҵ�о� > http://www.searchenginewatch.com/ > > �� > > <<���� > > > _________________________________________________________ > Do You Yahoo!? > ���ʵ���,���ֵ��� - �Ż��Ƴ�������ֵ����ܱ�! > http://cn.ent.yahoo.com/newsletter/index.html > > -- > To unsubscribe, e-mail: > > For additional commands, e-mail: > > __________________________________________________ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- To unsubscribe, e-mail: For additional commands, e-mail: