Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 50916 invoked from network); 4 May 2008 08:21:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 May 2008 08:21:30 -0000 Received: (qmail 94370 invoked by uid 500); 4 May 2008 08:21:23 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 93821 invoked by uid 500); 4 May 2008 08:21:22 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 93810 invoked by uid 99); 4 May 2008 08:21:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 May 2008 01:21:22 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of liccohu@hotmail.com designates 65.54.246.218 as permitted sender) Received: from [65.54.246.218] (HELO bay0-omc3-s18.bay0.hotmail.com) (65.54.246.218) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 May 2008 08:20:27 +0000 Received: from BAY113-DS7 ([65.54.168.94]) by bay0-omc3-s18.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 4 May 2008 01:20:47 -0700 X-Originating-IP: [222.66.106.34] X-Originating-Email: [liccohu@hotmail.com] Message-ID: From: "kai.hu" In-Reply-To: <011601c8a436$87adc240$b208a8c0@WangJianxin> <0C5F3D1247CCF341B9B8DD7B447FA492501A9A@CORPUSMX70A.corp.emc.com> <016901c8a43f$47c9edd0$b208a8c0@WangJianxin> <839ba01c0804220036h51992647yaecedad17597f0dc@mail.gmail.com> To: References: <011601c8a436$87adc240$b208a8c0@WangJianxin> <0C5F3D1247CCF341B9B8DD7B447FA492501A9A@CORPUSMX70A.corp.emc.com> <016901c8a43f$47c9edd0$b208a8c0@WangJianxin> <839ba01c0804220036h51992647yaecedad17597f0dc@mail.gmail.com> Subject: =?utf-8?B?UmU6IE5lZWQgYWRkdGlvbmFsIGluZm8gZm9yIEZpZWw=?= =?utf-8?B?ZO+8iOW4jOacm+eci+W+l+aHguS4reaWh+eahOaci+WPi+W4ruaIkeWHuuWHug==?= =?utf-8?B?5Li75oSP77yJ?= Date: Sun, 4 May 2008 16:20:45 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original X-Unsent: 1 Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 12.0.1606 X-MimeOLE: Produced By Microsoft MimeOLE V12.0.1606 X-OriginalArrivalTime: 04 May 2008 08:20:47.0743 (UTC) FILETIME=[C18978F0:01C8ADBF] X-Virus-Checked: Checked by ClamAV on apache.org 你只要索引并分词“下午去开会”就行了,把对应的时间保存进去。 如document.add(new Field("sub","下午去开会",Field.Store.YES,Field.Index.TOKENIZED)); document.add(new Field("time","01:02:02",Field.Store.YES,Field.Index.UN_TOKENIZED)); 到时候搜索出的单个document里就包含这两个Field了。 only index and tokenized "下午去开会",and store the time with this sub. -------------------------------------------------- From: "Cedric Ho" Sent: Tuesday, April 22, 2008 3:36 PM To: Subject: Re: Need addtional info for Field(希望看得懂中文的朋友帮我出出主意) > In that case you may want to index each: > > Field("Sub","下午去开会","01:02:02"); > > as a separate document. So your document contains 3 fields > 1. title > 2. time > 3. sub > > then you can get both title and time by searching the "sub" field. > > Cedric > > > 2008/4/22 王建新 : >> >> 谢谢,我只是检索sub,不检索时间,在检索sub时,只想得到匹配Field对应的时间。 >> >> 用payload似乎不可以? >> >> >> >> ----- Original Message ----- >> From: >> To: >> Sent: Tuesday, April 22, 2008 1:55 PM >> Subject: RE: Need addtional info for Field(希望看得懂中文的朋友帮我出出主意) >> >> >> Try to use payload which is stored as additional information. Currently >> lucene only support per token payload, but you can add an arbitrary token >> for the time information. >> >> I am not sure what are the query information? Only the subtitle or both >> subtitle and time? >> >> Regards, >> >> -----Original Message----- >> From: 王建新 [mailto:lieutroy@gmail.com] >> Sent: Tuesday, April 22, 2008 1:06 PM >> To: java-user >> Subject: Need addtional info for Field(希望看得懂中文的朋友帮我出出主意) >> >> >> 用英文可能描述得不是很清楚,不好意思:) >> >> >> ----- Original Message ----- >> From: 王建新 >> To: Chris >> Sent: Tuesday, April 22, 2008 9:52 AM >> Subject: Re: Need addtional info for Field >> >> >> 谢谢。 >> 我的问题是这样的:要对一批视频文件(video)建立索引(index),在建立索引之前,我已经分析出了在视频的什么时间出现了什么样的字幕内容。 >> 在这种情况下,一个视频节目就相当于一个Document,那么需要(希望)对字幕建立索引,如下: >> Field("Sub","下午去开会","01:02:02"); >> Field("Sub","后天去开会","01:03:05"); >> [注:"01:02:02"是附属的时间,lucene没有提供这种用法。] >> >> 这两个Field表示在当前的视频节目中,在01:02:02时间出现了字幕"下午去开会",在01:03:05时间出现了"后天去开会",如果用户(User)搜索"下午",当前视频节目是可以匹配的,但是只匹配到了第一个Field,只需要知道时间"01:02:02"。如果用户搜索"开会",则两个Field都可以匹配到。因此需要知道时间"01:02:02"和"01:03:05"。 >> 不知道我有没有说清楚。 >> >> 我想知道lucene是不是可以通过某种方式解决这个问题,如果不行的话,需要怎样修改lucene呢? >> >> 王建新 >> ----- Original Message ----- >> From: Chris >> To: 王建新 >> Sent: Monday, April 21, 2008 7:34 PM >> Subject: Re: Need addtional info for Field >> >> >> 您的功能可以再清楚一點嗎,因為其實這樣處理,好像要斷詞.... >> >> 但看到您沒斷,而且欄位名稱一樣是 multi-pair 值的話,不是用 String 存哦 >> >> 以上 >> Chris. >> >> >> 2008/4/21, 王建新 : >> 你看得懂中文吗? >> >> 我不是很明白你的意思。 >> 你是说可以用lucene现有的功能来解决这个问题吗? >> >> ----- Original Message ----- >> From: Chris >> To: 王建新 >> Sent: Monday, April 21, 2008 5:14 PM >> Subject: Re: Need addtional info for Field >> >> >> This problem is not solve with lucene but or method will solve it. >> >> The structure is not define as this as well ...... >> >> You may check it clear.... >> >> above >> Chris. >> >> >> 2008/4/21, 王建新 : >> hi Chris, it is me "王建新" >> >> I have a new problem, Could you give me any advice? Thank you. >> >> >> I want to use lucene with some additional info,like: >> >> 1.index >> Document additionalDoc=ew Document() >> >> additionalDoc.add(new Field("field","AA BB","Addtional info >> ...............")); >> additionalDoc.add(new Field("field","BB CC","Addtional info >> 222222222222222222222222...............")); >> >> writer.addDocument(additionalDoc) >> >> ........ >> >> >> 2. search >> >> Searcher searcher; >> .... >> >> searcher.search(termQuery("field","BB")); >> >> >> >> >> in this condition, I want lucene returns the additionalDoc , >> also know which fileds were matched, then I will get the additional info >> from the matched fields. >> >> Can lucene make it in version 2.3.1? >> >> >> >> -- >> Chris Lin >> chrislin0426@gmail.com >> Taipei , Taiwan. >> ----------------------------------------------------------- >> >> >> >> -- >> Chris Lin >> chrislin0426@gmail.com >> Taipei , Taiwan. >> ----------------------------------------------------------- >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >> For additional commands, e-mail: java-user-help@lucene.apache.org >> > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org