search on a field by a single word

2015-02-10 Thread wangdong
Hi folks I have a question as follows: suppose there are 3 document in field "name": 1) a b c 2) a b 3) a I just want to retrival doc 3) only. I try to use syntax like this: name:"a" but I find it is not correct.is there any way to solve my question. please help me! thanks ahead! --

Re: combine to MultiTermQuery with OR

2015-02-10 Thread Nitin Kothwal
Hi sascha, You can do with boolean query, Take your three queries and OR them with boolean clause Occur.should. -Nitin On Tuesday 10 February 2015 08:58 PM, Sascha Janz wrote: Hi, i want to combine two MultiTermQueries. One searches over FieldA, one over FieldB. Both queries should be

StandardQueryParser with date/time fields stored as longs

2015-02-10 Thread Jon Stewart
Hello, I've done a lot of googling, but haven't stumbled upon the magic answer: how does one use StandardQueryParser with numeric fields representing timestamps, to allow for range queries? When indexing, my timestamp fields are ISO 8601 strings. I'm parsing them and then storing the milliseconds

BulkScorer and .explain() compute scores separately?

2015-02-10 Thread danield
I have subclassed the BooleanQuery and changed the BooleanWeight constructor to change the way the /coord/ and /idf /components of the similiarity formula are computed, and my changes work as expected when calling IndexSearcher.explain(). However, I now find that when just calling IndexSearcher.se

RE: re-mapping lucene index

2015-02-10 Thread Uwe Schindler
Hi, In Linux/Solaris/BSD/... operating systems you can delete files while they are open (or mmapped, does not matter). The inode/file on disk stays alive until everything is closed ("delete on last close" semantics), it just disappears from the directory listing, so you cannot open new handles

Re: Re: combine to MultiTermQuery with OR

2015-02-10 Thread Ian Lea
Yep, that looks good to me. -- Ian. On Tue, Feb 10, 2015 at 5:01 PM, Sascha Janz wrote: > hm, already thought this could be the solution but didn't know how to do the > or Operation > > so i tried this > > BooleanQuery bquery = new BooleanQuery(); > bquery.add(queryFieldA, BooleanClause.Occu

Re: re-mapping lucene index

2015-02-10 Thread Vijay B
Appreciate it Mike. That answeres it all. BTW we use solaris. On Tue, Feb 10, 2015 at 2:29 PM, Michael McCandless < luc...@mikemccandless.com> wrote: > It's fine if writer and reader are in separate JVMs. > > You really should not "rm -rf" yourself. > > It's better to let Lucene's do it, e.g. it

Re: re-mapping lucene index

2015-02-10 Thread Michael McCandless
It's fine if writer and reader are in separate JVMs. You really should not "rm -rf" yourself. It's better to let Lucene's do it, e.g. it's transactional at that point so that if your new IndexWriter (that deleted all docs) crashes before it could commit, the old index is still intact. It also en

Re: re-mapping lucene index

2015-02-10 Thread Vijay B
searching and indexing apps run in diffrent jvms. we use lucene 4.7 and using the default openmode. For full indexing, we use java.io.File.delete() to recursively delete index directory contents. will remapping cause any issues in this case if I dont use options you suggested? On Tue, Feb 10, 201

Re: re-mapping lucene index

2015-02-10 Thread Michael McCandless
Just open a new IndexWriter with OpenMode.CREATE. It will replace the index. Or if you already have an IW open, use deleteAll. Mike McCandless http://blog.mikemccandless.com On Tue, Feb 10, 2015 at 1:31 PM, Vijay B wrote: > We use MMapdirectory impl. in our search application. Occasionally w

re-mapping lucene index

2015-02-10 Thread Vijay B
We use MMapdirectory impl. in our search application. Occasionally we need to do a full indexing by dropping entire directory contents. How does re-mapping work with MMapDirectory as the directory contents are going to replace with new ones? is this going to be seamless or an application restart re

Aw: Re: combine to MultiTermQuery with OR

2015-02-10 Thread Sascha Janz
hm,  already thought this could be the solution but didn't know how to do the or Operation so i tried this   BooleanQuery bquery = new BooleanQuery(); bquery.add(queryFieldA, BooleanClause.Occur.SHOULD); bquery.add(queryFieldB, BooleanClause.Occur.SHOULD); this is the correct way? Gesendet: Di

Re: combine to MultiTermQuery with OR

2015-02-10 Thread Ian Lea
org.apache.lucene.search.BooleanQuery. -- Ian. On Tue, Feb 10, 2015 at 3:28 PM, Sascha Janz wrote: > > Hi, > > i want to combine two MultiTermQueries. > > One searches over FieldA, one over FieldB. Both queries should be combined > with "OR" operator. > > so in lucene Syntax i want to searc

combine to MultiTermQuery with OR

2015-02-10 Thread Sascha Janz
Hi,   i want to combine two MultiTermQueries.   One searches over FieldA, one over FieldB.  Both queries should be combined with "OR" operator.   so in lucene Syntax i want  to search   FieldA:Term1 OR FieldB:Term1,   FieldA:Term2 OR FieldB:Term2, FieldA:Term3 OR FieldB:Term3...   how can i do t

Re: Request to be added to the ContributorsGroup

2015-02-10 Thread Steve Rowe
Hi Charlie, You need to create an account on the wiki and tell us your account name. Steve > On Feb 10, 2015, at 3:46 AM, Charlie Picorini > wrote: > > Dear Lucene Team, > > Please add me to the contributorsGroup so that I can add IntraCherche which > is actually based on Lucene. > > Kind r

Request to be added to the ContributorsGroup

2015-02-10 Thread Charlie Picorini
Dear Lucene Team, Please add me to the contributorsGroup so that I can add IntraCherche which is actually based on Lucene. Kind regards,

RE: Lucene search in attachments

2015-02-10 Thread Uwe Schindler
Hi, > -Original Message- > From: sreedevi s [mailto:sreedevi.payik...@gmail.com] > Sent: Tuesday, February 10, 2015 10:46 AM > To: java-user@lucene.apache.org > Subject: Re: Lucene search in attachments > > Hi Uwe, > Thank you for the info update.I will remove the limit in tika and check.

Re: Lucene search in attachments

2015-02-10 Thread sreedevi s
Hi Uwe, Thank you for the info update.I will remove the limit in tika and check. So, my understanding is,currently lucene doesnt have any restriction on number of terms per field but when a term is greater then 2^15 bytes it is silently ignored at indexing time – a message is logged in to infoStre

RE: Indexing and searching a DateTime range

2015-02-10 Thread Uwe Schindler
Hi, > OK. I found the Alfresco code on GitHub. So it's open source it seems. > > And I found the DateTimeAnalyser, so I will just take that code as a starting > point: > https://github.com/lsbueno/alfresco/tree/master/root/projects/repository/ > source/java/org/alfresco/repo/search/impl/lucene/an

RE: Lucene search in attachments

2015-02-10 Thread Uwe Schindler
Hi, There is no restriction to 1 characters inside Lucene and there never was one. In earlier Lucene versions (long time ago) there was an implicit restriction to 10,000 TERMS (not characters). This is no longer the case. If you still want this, you have to wrap your Analyzer: http://goo.gl

Re: Lucene search in attachments

2015-02-10 Thread sreedevi s
No David. By increasing the value or I can set to -1 to make it unlimited but still I cannot assure that my whole text can be searchable, which is still a problem with large files because only the part which is indexed will be searchable. Was looking for some alternatives. Best Regards, Sreedevi S

Re: Lucene search in attachments

2015-02-10 Thread David Pilato
I don’t understand. If you don’t raise this restriction to a higher value (or to -1), all the text won’t be extracted so only a subset of the text will be indexed. Non indexed parts of the text won’t be searchable. Did I misunderstand your question? -- David Pilato | Technical Advocate | Elasti

Re: Lucene search in attachments

2015-02-10 Thread sreedevi s
Thank you David. Yes, it has a restriction of characters to 1. But for large files, what could be done in that case? Best Regards, Sreedevi S On Tue, Feb 10, 2015 at 2:04 PM, David Pilato wrote: > If you don’t index content, you won’t be able to search for it I guess. > That said, Tika can

Re: Lucene search in attachments

2015-02-10 Thread David Pilato
If you don’t index content, you won’t be able to search for it I guess. That said, Tika can have this extracted characters limit. See indexedChars below: tika().parseToString(new BytesStreamInput(content, false), metadata, indexedChars); [1] https://github.com/elasticsearch/elasticsearch-mappe

Lucene search in attachments

2015-02-10 Thread sreedevi s
Hi, Which is the best method to search in attachments in lucene? I am new to lucene and I am using version 4.10.2. By making use of Tika, I know I can convert files to text and then index it as another field. But for large files that will not be the ideal solution. I believe the maximum charact