From lucene-user-return-1270-qmlist-jakarta-archive-lucene-user=jakarta.apache.org@jakarta.apache.org Wed Mar 27 21:14:30 2002 Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 99437 invoked from network); 27 Mar 2002 21:14:30 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 27 Mar 2002 21:14:30 -0000 Received: (qmail 6744 invoked by uid 97); 27 Mar 2002 21:14:21 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@jakarta.apache.org Received: (qmail 6726 invoked by uid 97); 27 Mar 2002 21:14:20 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 6707 invoked from network); 27 Mar 2002 21:14:20 -0000 Message-ID: <3212503.1017263656027.JavaMail.digimem@venus> Date: Wed, 27 Mar 2002 21:14:15 +0000 (GMT) From: Ian Lea To: Aruna Raghavan Subject: RE: Lucene with Number+Text Cc: 'Lucene Users List' Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_12_7776386.1017263655981" X-Mailer: digimemmailer v1.0 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_Part_12_7776386.1017263655981 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > I am indexing as text field. Search for 05qzFebqz01, 05q* do not work. I am > using a StandardAnalyzer. Search for 05* works. > Searches on another word cq6r work fine. > Any idea why this is happening? Works just fine for me. Test program attached. -- Ian. ---------------------------------------------------------------------- Searchable personal storage and archiving from http://www.digimem.net/ ------=_Part_12_7776386.1017263655981 Content-Type: text/plain; name=LuceneTest.java Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=LuceneTest.java import org.apache.lucene.queryParser.*; import org.apache.lucene.search.*; import org.apache.lucene.index.*; import org.apache.lucene.analysis.*; import org.apache.lucene.analysis.standard.*; import org.apache.lucene.document.*; import org.apache.lucene.store.*; public class LuceneTest { RAMDirectory ramdir; Analyzer analyzer; IndexWriter writer; IndexReader reader; Searcher searcher; public LuceneTest() { analyzer = new StandardAnalyzer(); ramdir = new RAMDirectory(); } public static void main(String args[]) throws Exception { LuceneTest ld = new LuceneTest(); ld.load(); ld.search(); } void load() throws Exception { writer = new IndexWriter(ramdir, analyzer, true); add("05qzFebqz01"); writer.close(); } void add(String s) throws Exception { Document d = new Document(); d.add(Field.Text("text", s)); System.out.println("Adding "+s); writer.addDocument(d); } void search() throws Exception { reader = IndexReader.open(ramdir); searcher = new IndexSearcher(reader); search("05qzFebqz01"); search("05q*"); search("05*"); } void search(String s) throws Exception { Query query = QueryParser.parse(s, "text", analyzer); Hits hits = searcher.search(query); System.out.println(s+" matched "+hits.length()); for (int i = 0; i < hits.length(); i++) { System.out.println(" " + hits.doc(i).get("text")); } } } ------=_Part_12_7776386.1017263655981 Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: ------=_Part_12_7776386.1017263655981--