??????Why does QueryBuilder.createBooleanQuery create something differentfrom input?

2014-05-13 Thread 308181687
Because of stupid bug in your app. I have tested your code, it work fine:


title:?? title:?? title: title:6500 title:?? title: title: 
title: title:?? title:?? title: title:??




--  --
??: "Cheng";;
: 2014??5??10??(??) 10:16
??: "java-user"; 

: Why does QueryBuilder.createBooleanQuery create something differentfrom 
input?



Hi,

I build a query using
QueryBuilder.createBooleanQuery("title","6500??").

When I check the query, the toString() of this query looks like:

Query: title:?? title: title: title:2. title: title: title:
title: title: title: title: title: title: title:?? 
title:??
title:3. title: title:?? title:?? title:?? title:?? title: title:?? 
title:
title: title:?? title:?? title: title: title: title: 
title:
title:?? title:?? title: title:?? title: title: title:logo 
title:
title: title:4.iphone title:2g title:?? title:3g title: title: 
title:??
title:?? title:0.9.3

This is totally different from the input 
"6500??".

Can someone tell me why?

Thanks

Re: How to locate a Phrase inside text (like a Browser text searcher)

2014-05-13 Thread teko
wow!! Thanks Michael!! It's works perfectly! thanks man!!



--
View this message in context: 
http://lucene.472066.n3.nabble.com/How-to-locate-a-Phrase-inside-text-like-a-Browser-text-searcher-tp4135075p4135449.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



Re: Lucene: Index Writer to write in multiple file instead make one heavy file

2014-05-13 Thread Michael McCandless
You can tell the MergePolicy to limit the maximum size of segments it
should merge.

Also, you should try to upgrade: 3.0.1 is REALLY old.

Mike McCandless

http://blog.mikemccandless.com


On Tue, May 13, 2014 at 1:58 AM, Yogesh patel
 wrote:
> HI
>
> I am using lucene 3.0.1. I am writing many documents with lucene
> Indexwriter. But Indexwriter add all documents into file which becomes more
> than 4GB in my case. so can i distribute files or partitioned ?
>
> --
>
>
>
>
> *Regards,Yogesh Patel*

-
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



Re: How to locate a Phrase inside text (like a Browser text searcher)

2014-05-13 Thread Emanuel Buzek
I was trying to solve pretty much the same thing few weeks back and I ended
up using the NGram tokenizer. Although it made my index much larger (the
index grew 15x), the fulltext queries are pretty fast and I don't have to
use wildcards in queries.
http://lucene.apache.org/core/4_4_0/analyzers-common/org/apache/lucene/analysis/ngram/NGramTokenizer.html

cheers, Ema


2014-05-13 2:39 GMT+02:00 Michael Sokolov :

> ShingleFilter can help with this; it concatenates neighboring tokens.  So
> a search for "good morning john" becomes a search for
>
> "goodmorning john" OR
> "good morningjohn" OR
> "good morning john"
>
> it makes your index much bigger because of all the terms, but you may find
> it's worth the cost
>
> -Mike
>
>
> On 5/11/2014 9:46 PM, Jack Krupansky wrote:
>
>> The word delimiter filter can help for "MorningJohn" by setting its
>> option to split on case change.
>>
>> You might be able to handle "Mailhow" using the
>> DictionaryCompoundWordTokenFilter, but that requires that you create a
>> complete dictionary of terms that can split off. That's not very practical.
>> In truth, Lucene/Solr doesn't have a good out of the box solution for this
>> use case.
>>
>> -- Jack Krupansky
>>
>> -Original Message- From: teko
>> Sent: Thursday, May 8, 2014 9:03 AM
>> To: java-user@lucene.apache.org
>> Subject: How to locate a Phrase inside text (like a Browser text searcher)
>>
>> Hi, someone can help me with it??
>> I need do a search to locate a phrase inside text, but, I need locate this
>> phrase on texts like that:
>> 'John Mail' <- phrase I want locate
>> ' Good Morning John Mail how are you? ' < I need find this phrase here
>> ' Good MorningJohn Mail how are you? ' < here too
>> ' GoodMorning John Mailhow are you? ' < and here
>>
>> I tried using with 'WhiteSpaceAnalyzer' and 'QueryParser'... but not work
>> (locate just in the first sample above... but not the others)
>>
>> Please, I really need help with it!
>> Thanks (note: Sorry my english!! xD)
>>
>>
>>
>> --
>> View this message in context: http://lucene.472066.n3.
>> nabble.com/How-to-locate-a-Phrase-inside-text-like-a-
>> Browser-text-searcher-tp4135075.html
>> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
>> For additional commands, e-mail: java-user-h...@lucene.apache.org
>>
>> -
>> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
>> For additional commands, e-mail: java-user-h...@lucene.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org
>
>


-- 
Emanuel Buzek
Software Engineer, ROKE.cz 
tel: +420 776 54 26 26


[lucene 4.6] NPE when calling IndexReader#openIfChanged

2014-05-13 Thread Clemens Wyss DEV
I am facing the following stacktrace:
java.lang.NullPointerException: null
  at java.io.File.(File.java:305) ~[na:1.6.0_26]
  at 
org.apache.lucene.store.NIOFSDirectory.openInput(NIOFSDirectory.java:80) 
~[lucene-core.jar:4.6.0 1543363 - simon - 2013-11-19 11:05:50]
  at 
org.apache.lucene.codecs.lucene40.BitVector.(BitVector.java:327) 
~[lucene-core.jar:4.6.0 1543363 - simon - 2013-11-19 11:05:50]
  at 
org.apache.lucene.codecs.lucene40.Lucene40LiveDocsFormat.readLiveDocs(Lucene40LiveDocsFormat.java:90)
 ~[lucene-core.jar:4.6.0 1543363 - simon - 2013-11-19 11:05:50]
  at 
org.apache.lucene.index.SegmentReader.(SegmentReader.java:131) 
~[lucene-core.jar:4.6.0 1543363 - simon - 2013-11-19 11:05:50]
  at 
org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:194)
 ~[lucene-core.jar:4.6.0 1543363 - simon - 2013-11-19 11:05:50]
  at 
org.apache.lucene.index.StandardDirectoryReader.doOpenIfChanged(StandardDirectoryReader.java:326)
 ~[lucene-core.jar:4.6.0 1543363 - simon - 2013-11-19 11:05:50]
  at 
org.apache.lucene.index.StandardDirectoryReader$2.doBody(StandardDirectoryReader.java:320)
 ~[lucene-core.jar:4.6.0 1543363 - simon - 2013-11-19 11:05:50]
  at 
org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:843)
 ~[lucene-core.jar:4.6.0 1543363 - simon - 2013-11-19 11:05:50]
  at 
org.apache.lucene.index.StandardDirectoryReader.doOpenFromCommit(StandardDirectoryReader.java:315)
 ~[lucene-core.jar:4.6.0 1543363 - simon - 2013-11-19 11:05:50]
  at 
org.apache.lucene.index.StandardDirectoryReader.doOpenNoWriter(StandardDirectoryReader.java:311)
 ~[lucene-core.jar:4.6.0 1543363 - simon - 2013-11-19 11:05:50]
  at 
org.apache.lucene.index.StandardDirectoryReader.doOpenIfChanged(StandardDirectoryReader.java:262)
 ~[lucene-core.jar:4.6.0 1543363 - simon - 2013-11-19 11:05:50]
  at 
org.apache.lucene.index.StandardDirectoryReader.doOpenIfChanged(StandardDirectoryReader.java:250)
 ~[lucene-core.jar:4.6.0 1543363 - simon - 2013-11-19 11:05:50]
  at 
org.apache.lucene.index.DirectoryReader.openIfChanged(DirectoryReader.java:170) 
~[lucene-core.jar:4.6.0 1543363 - simon - 2013-11-19 11:05:50]

Unfortunately not always. Looks like j.i.File is getting param child == 
null
What might go wrong in openIfChanged?
Thanks for any advices/hints
Clemens

-
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



Re: How to locate a Phrase inside text (like a Browser text searcher)

2014-05-13 Thread Michael Sokolov
ShingleFilter can help with this; it concatenates neighboring tokens.  
So a search for "good morning john" becomes a search for


"goodmorning john" OR
"good morningjohn" OR
"good morning john"

it makes your index much bigger because of all the terms, but you may 
find it's worth the cost


-Mike

On 5/11/2014 9:46 PM, Jack Krupansky wrote:
The word delimiter filter can help for "MorningJohn" by setting its 
option to split on case change.


You might be able to handle "Mailhow" using the 
DictionaryCompoundWordTokenFilter, but that requires that you create a 
complete dictionary of terms that can split off. That's not very 
practical. In truth, Lucene/Solr doesn't have a good out of the box 
solution for this use case.


-- Jack Krupansky

-Original Message- From: teko
Sent: Thursday, May 8, 2014 9:03 AM
To: java-user@lucene.apache.org
Subject: How to locate a Phrase inside text (like a Browser text 
searcher)


Hi, someone can help me with it??
I need do a search to locate a phrase inside text, but, I need locate 
this

phrase on texts like that:
'John Mail' <- phrase I want locate
' Good Morning John Mail how are you? ' < I need find this phrase here
' Good MorningJohn Mail how are you? ' < here too
' GoodMorning John Mailhow are you? ' < and here

I tried using with 'WhiteSpaceAnalyzer' and 'QueryParser'... but not work
(locate just in the first sample above... but not the others)

Please, I really need help with it!
Thanks (note: Sorry my english!! xD)



--
View this message in context: 
http://lucene.472066.n3.nabble.com/How-to-locate-a-Phrase-inside-text-like-a-Browser-text-searcher-tp4135075.html

Sent from the Lucene - Java Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

-
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org




-
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



Re: writer.updateDocument() not working (possible bug?)

2014-05-13 Thread Jamie

Mike

Thanks for the tip. The doc was being loaded using the method 
searcher.doc(scoreDoc.doc,getLoadFields()). Obviously, only a minority 
of fields were being loaded. However, when using the method 
searcher.doc(scoreDoc.doc), the doc appears to update when 
updateDocument(term,doc) is called. Can you confirm whether the full 
document will be returned when I call searcher.doc(scoreDoc.doc)? if 
not, what is the recommended way to get the original document from the 
index (if possible)? Perhaps, reader.document(i)?


Thanks in advance

Jamie

On 2014/05/13, 3:30 PM, Michael McCandless wrote:

How did you produce the document that you are sending to
updateDocument?  Are you loading it from IndexReader.document() or
IndexSearcher.doc(), changing it, then passing that to
IW.updateDocument?  If so, that's probably your bug: a loaded document
is not identical to the original Document you indexed.  In 5.0 we've
fixed this to be strongly typed ...

Mike McCandless

http://blog.mikemccandless.com


On Tue, May 13, 2014 at 9:24 AM, Jamie  wrote:

Greetings

I am using Lucene NRT search. After calling writer.updateDocument(term, doc)
and then search(), the document is no longer visible in the search results.
The program must be restarted to see it again. In addition, the update is
not being applied. The original document (before the update) is visible in
the search results. If updateDocument(term,doc) is called, passing the
original doc (without any changes), the doc is still removed from the index
(i.e. the change is not the cause). On each search I am calling indexReader
= DirectoryReader.open(writer, true); We have tried to call commit() and/or
close() immediately after the update, but it makes no difference.

This occurs both in Lucene 4.7.2 and 4.8. As far as we know, our code used
to work with prior versions of Lucene. Has anyone encountered this?

Regards

Jamie







-
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



RE: Lucene: Index Writer to write in multiple file instead make one heavy file

2014-05-13 Thread Toke Eskildsen
Yogesh patel [yogeshpateldai...@gmail.com] wrote:
> I am using lucene 3.0.1. I am writing many documents with lucene
> Indexwriter. But Indexwriter add all documents into file which becomes more
> than 4GB in my case. so can i distribute files or partitioned ?

Normally Lucene does not produce a single large file. I guess you are 
performing an optimize. Don't do that (it is not really recommended anyway) and 
you should have multiple smaller files.

If that was not clear, then please show us the part of your code that handles 
index updates.

- Toke Eskildsen
-
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org