Hi,
You should get the `Hits' from `IndexSearcher.search(...)'
You could refer to the example code in the Lucene source package, or have a
look at the book `Lucene in Action'
2008/2/23, sumittyagi <[EMAIL PROTECTED]>:
>
>
> here is my code, i am just starting, so having little bit of trouble in
Of course, these are programming errors nothing really related to
Lucene.
Hits hits;
Int hitCount = hits.length
This does not make sense. You have just declared hits. It must be
created before using it.
The second error should disapper if you add throws declaration or
try/catch block.
By the wa
here is my code
package db;
import java.io.*;
import java.util.*;
import java.lang.*;
import org.apache.lucene.search.Hits;
import org.apache.lucene.search.Hit;
public class comm{
public static void main(String[] args)
{
System.out.println("hi");
It should be hits.id(i), not hits.id[i]. Note id is a method not an
array.
-Original Message-
From: sumittyagi [mailto:[EMAIL PROTECTED]
Sent: Friday, February 22, 2008 4:06 PM
To: java-user@lucene.apache.org
Subject: Re: How to get the doc ID from HITS
here is my code, i am just starti
here is my code, i am just starting, so having little bit of trouble in
starting, i am just trying to access some values and then want to print it
to get started..
here is my code
package db;
import java.io.*;
import java.util.*;
import java.lang.*;
import org.apache.lucene.search.Hits;
import o
thanks for replying
it may be a silly question but what do in the code
Hits hits = ...
int hitCount = hits.length();
for (int i=0;i
> Two ways to work through the Hits object getting docids are:
>
> Hits hits = ...
> int hitCount = hits.length();
> for (int i=0;iint docId = hits.id[i] ;
>
> That will let you do it, be warned however there is most definitely a
> significant performance degradation associated with doing this.
Yes of course. Like in a relational database with a leading wildcard.
-
To unsubscribe, e
> 1) See setAllowLeadingWildcard in QP.
Oh damned... late in the evening ;)
Hm, just tested it:
Searching for "format" works.
Searching for "form*" works.
Searching for "*ormat" works NOT.
Confused again ;)
-
To unsubscribe,
What you need is to set the allow leading wildcard flag.
qp.setAllowLeadingWildcard(true);
(where qp is a query parser instance)
That will let you do it, be warned however there is most definitely a
significant performance degradation associated with doing this.
Matt
[EMAIL PROTECTED] wrote
Two solutions come to mind:
1) See setAllowLeadingWildcard in QP.
2) Additionally ndex reversed tokens.
Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
- Original Message
> From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> To: java-user@lucene.apache.org
> Sent: Friday
Hi,
using WildcardQuery directly it is possible to search for suffixes like
"*foo".
The QueryParser throws an exception that this is not allowed in a
WildcardQuery.
Hm, now I'm confused ;)
How can I configure the QueryParser to allow a wildcard as first character?
Thank you
-
Hi, I'm trying to use MoreLikeThis but I can't find how to make a
MoreLikeThis query that will return related documents given a document and
some conditions, like country field in the related documents should be 1,
etc.
Is there any documentation on how to do this kind of queries?
Thanks,
Jonat
Lucene only allows for one open transaction at a time per index (IndexWriter).
So if you have multiple threads, and each of them is making changes,
all those changes will fall under one transaction, controlled by the
single writer the threads are sharing.
If you really want separate transactions,
Okay, Thanks a lot for answering my questions. I'll give the split string
thing a try :-) .
Best Regards
Jens Burkhardt
Grant Ingersoll-6 wrote:
>
>
> On Feb 21, 2008, at 6:53 AM, JensBurkhardt wrote:
>>
>> Hello again,
>>
>> Thanks for your immediate response. As i understand, the only way
On Thu, 2008-01-17 at 10:24 -0500, Erick Erickson wrote:
> There's a section on the Lucene Wiki for real world
> experiences etc. After you are satisfied with your
> tests, it'd be great if you could add your measurements
> to the Wiki!
Could you please point me to the page? I am unable to find it
Thanks Mike for you replay.
What about multithreading? If in one transaction can make both
adding and deleting documents and in the same time can be more then
one open transaction. Should each thread use it personal Index and
after commiting transaction somehow it merges or all threads must use o
Yes, that's exactly what I wanted. I used Luke for a while but never noticed
the Reconstruct feature, thanks.
Itamar.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, February 22, 2008 3:22 PM
To: java-user@lucene.apache.org
Subject: RE: Rebuilding Docu
You can use Luke to rebuild the document. It will show you the terms of the
analyzed document, not the original content.
And this is what you want, if I understood you correctly.
> -Original Message-
> From: Itamar Syn-Hershko [mailto:[EMAIL PROTECTED]
> Sent: Freitag, 22. Februar 2008 1
Hi,
Is it possible to re-create a document from an index, if its not stored?
What I'm looking for is a way to have a text document with the text AFTER it
was analyzed, so I can see how my analyzer handles certain cases. So that
means I don't care if I will not get the original document. I want to
Looks like an issue with the build process.
MoreLikeThis moved to the contrib\queries area some time ago.
Thanks for the report - we'll need to fix this.
- Original Message
From: Jonathan Ariel <[EMAIL PROTECTED]>
To: java-user@lucene.apache.org
Sent: Friday, 22 February, 2008 12:36:2
You should open the IndexWriter with autoCommit=false, then make
changes. During this time, any reader that opens the index will not
see any changes you are making.
Then, you can call close() to commit the changes to the index, or
abort() to rollback the index to the starting state (when the writ
Hi,
I've downloaded Lucene 2.3.0 binaries and in the contrib folder I can see
the Similarity package, but inside the Jar there are no classes!
Downloading the sources I ran into the same issue.
Am I doing something wrong? Where should I get the MoreLikeThis classes
from?
Thanks!
Jonathan
Hi.
I have a question about transactions in Lucene.
Lets say I have 1000 Documents and want to add all of them or none of
them(if something happen) to the index.
What the best strategy to do it in multithreaded environment?
Sergey Kabashnyuk.
---
Hello,
we have chosen to use Lucene as the metadata database for a project.
Everything works great, from indexing to multi-threading search.
Also, we have chosen to split storage and security. It works great,
except when we come to filtering.
I have understood that Filter should set bits on docu
24 matches
Mail list logo