Use boolean operator "-", the result is incorrect

2020-04-07 Thread slly
Hello Folks,
We are using Solr 7.3.1,  I write the following two lines of data into 
collection:
id, name_s, age_i
1, a, 10
2, b, 10
Use the following query syntax:
-name_s:a OR age_i:10


I think we should return two pieces of data, but actually only one piece of 
data:
id, name_s, age_i
2, b, 10


Did I get it wrong?  Looking forward to some valuable suggestions. Thanks.

Re:Use boolean operator "-", the result is incorrect

2020-04-08 Thread slly






If the following query is executed, the result is different:


id:("1" "2") AND (-name_s:a) --> numFound is 0 


id:("1" "2") AND -(name_s:a)--> numFound is 1 








At 2020-04-08 14:56:26, "slly"  wrote:
>Hello Folks,
>We are using Solr 7.3.1,  I write the following two lines of data into 
>collection:
>id, name_s, age_i
>1, a, 10
>2, b, 10
>Use the following query syntax:
>-name_s:a OR age_i:10
>
>
>I think we should return two pieces of data, but actually only one piece of 
>data:
>id, name_s, age_i
>2, b, 10
>
>
>Did I get it wrong?  Looking forward to some valuable suggestions. Thanks.


Re:Re: Use boolean operator "-", the result is incorrect

2020-04-08 Thread slly
Thanks Bernd for your reply.
 I run the query on the Solr Web UI in Solr 7.3.1/7.7.2, the screenshot of my 
execution results is as follows,  I don't understand whether there is a 
grammatical error ?
1. -name_s:a OR age_i:10




2. id:("1" "2") AND (-name_s:a)




At 2020-04-08 16:33:20, "Bernd Fehling"  wrote:
>Looks correct to me.
>
>You have to obey the level of the operators and the parenthesis.
>Turn debugQuery on to see the results of parsing of your query.
>
>Regards
>Bernd
>
>Am 08.04.20 um 09:34 schrieb slly:
>> 
>> 
>> If the following query is executed, the result is different:
>> 
>> 
>> id:("1" "2") AND (-name_s:a) --> numFound is 0 
>> 
>> 
>> id:("1" "2") AND -(name_s:a)--> numFound is 1 
>> 
>> 
>> 
>> At 2020-04-08 14:56:26, "slly"  wrote:
>>> Hello Folks,
>>> We are using Solr 7.3.1,  I write the following two lines of data into 
>>> collection:
>>> id, name_s, age_i
>>> 1, a, 10
>>> 2, b, 10
>>> Use the following query syntax:
>>> -name_s:a OR age_i:10
>>>
>>>
>>> I think we should return two pieces of data, but actually only one piece of 
>>> data:
>>> id, name_s, age_i
>>> 2, b, 10
>>>
>>>
>>> Did I get it wrong?  Looking forward to some valuable suggestions. Thanks.



 





 

Re:Re: Use boolean operator "-", the result is incorrect

2020-04-08 Thread slly



Thanks Bernd for your reply. 
Can you tell me what your query syntax looks like?







At 2020-04-08 16:33:20, "Bernd Fehling"  wrote:
>Looks correct to me.
>
>You have to obey the level of the operators and the parenthesis.
>Turn debugQuery on to see the results of parsing of your query.
>
>Regards
>Bernd
>
>Am 08.04.20 um 09:34 schrieb slly:
>> 
>> 
>> If the following query is executed, the result is different:
>> 
>> 
>> id:("1" "2") AND (-name_s:a) --> numFound is 0 
>> 
>> 
>> id:("1" "2") AND -(name_s:a)--> numFound is 1 
>> 
>> 
>> 
>> At 2020-04-08 14:56:26, "slly"  wrote:
>>> Hello Folks,
>>> We are using Solr 7.3.1,  I write the following two lines of data into 
>>> collection:
>>> id, name_s, age_i
>>> 1, a, 10
>>> 2, b, 10
>>> Use the following query syntax:
>>> -name_s:a OR age_i:10
>>>
>>>
>>> I think we should return two pieces of data, but actually only one piece of 
>>> data:
>>> id, name_s, age_i
>>> 2, b, 10
>>>
>>>
>>> Did I get it wrong?  Looking forward to some valuable suggestions. Thanks.


Re:Re: Use boolean operator "-", the result is incorrect

2020-04-08 Thread slly
My default query operator is OR.There are two pieces of data in the index:
{ "id":"1", "name_s":"a", "age_i":10, "_version_":1663396766955864064}, { 
"id":"2", "name_s":"b", "age_i":10, "_version_":1663396767058624512}] }


  1.   -name_s:a OR age_i:10  # I think two pieces of data should be 
returned, but only one

"rawquerystring":"-name_s:a age_i:10", "querystring":"-name_s:a age_i:10", 
"parsedquery":"-name_s:a IndexOrDocValuesQuery(age_i:[10 TO 10])", 
"parsedquery_toString":"-name_s:a age_i:[10 TO 10]", "QParser":"LuceneQParser",



  2.  id:("1" "2") AND (-name_s:a) # I think one data should be returned, but 0 
data 

"rawquerystring":"id:(\"1\" \"2\") AND (-name_s:a)", "querystring":"id:(\"1\" 
\"2\") AND (-name_s:a)", "parsedquery":"+(id:1 id:2) +(-name_s:a)", 
"parsedquery_toString":"+(id:1 id:2) +(-name_s:a)", "QParser":"LuceneQParser",





At 2020-04-08 17:46:37, "Bernd Fehling"  wrote:
>What is debugQuery telling you about:
>- "rawquerystring"
>- "querystring"
>- "parsedquery"
>- "parsedquery_toString"
>- "QParser"
>
>Also what is your default query operator, AND or OR?
>This is what matters for your second example with  id:("1" "2")
>It could be  id:("1" AND "2")  or  id:("1" OR "2") .
>
>Regards
>Bernd
>
>Am 08.04.20 um 11:30 schrieb slly:
>> Thanks Bernd for your reply.
>>  I run the query on the Solr Web UI in Solr 7.3.1/7.7.2, the screenshot of 
>> my execution results is as follows,  I don't understand whether there is a 
>> grammatical error ?
>> 1. -name_s:a OR age_i:10
>> 
>> 2. id:("1" "2") AND (-name_s:a)
>> 
>> 
>> At 2020-04-08 16:33:20, "Bernd Fehling"  
>> wrote:
>>> Looks correct to me.
>>>
>>> You have to obey the level of the operators and the parenthesis.
>>> Turn debugQuery on to see the results of parsing of your query.
>>>
>>> Regards
>>> Bernd
>>>
>>> Am 08.04.20 um 09:34 schrieb slly:
>>>>
>>>>
>>>> If the following query is executed, the result is different:
>>>>
>>>>
>>>> id:("1" "2") AND (-name_s:a) --> numFound is 0 
>>>>
>>>>
>>>> id:("1" "2") AND -(name_s:a)--> numFound is 1 
>>>>
>>>>
>>>>
>>>> At 2020-04-08 14:56:26, "slly"  wrote:
>>>>> Hello Folks,
>>>>> We are using Solr 7.3.1,  I write the following two lines of data into 
>>>>> collection:
>>>>> id, name_s, age_i
>>>>> 1, a, 10
>>>>> 2, b, 10
>>>>> Use the following query syntax:
>>>>> -name_s:a OR age_i:10
>>>>>
>>>>>
>>>>> I think we should return two pieces of data, but actually only one piece 
>>>>> of data:
>>>>> id, name_s, age_i
>>>>> 2, b, 10
>>>>>
>>>>>
>>>>> Did I get it wrong?  Looking forward to some valuable suggestions. Thanks.
>> 


Re:Re: Use boolean operator "-", the result is incorrect

2020-04-08 Thread slly



Thank you very much for your reply. I have understood the meaning of it.  


https://lucidworks.com/post/why-not-and-or-and-not/



At 2020-04-09 01:45:14, "Chris Hostetter"  wrote:
>: Solr/Lucene do not employ boolean logic. See Hossman’s excellent post:
>: 
>: https://lucidworks.com/post/why-not-and-or-and-not/
>: 
>: Until you internalize this rather subtle difference, you’ll be surprised. A 
>lot ;).
>: 
>: You can make query parsing look a lot like boolean logic by carefully using 
>parentheses…
>
>Yup.  and to circle back to the original request...
>
>: >>> id, name_s, age_i
>: >>> 1, a, 10
>: >>> 2, b, 10
>: >>> Use the following query syntax:
>: >>> -name_s:a OR age_i:10
>
>tht says "Find all docs where age==10, then exclude docs where name==a
>
>If what you want is "all docs where name!=a, combined with all docs where 
>age==10" that would be...
>
>   (*:* -name_s:a) age_i:10
>
>
>-Hoss
>http://www.lucidworks.com/


MIGRATE without split.key?

2020-05-20 Thread slly
Hello everyone,


I want to migrate data from one collection to another with MIGRATE API, but if 
this parameter split.key is not specified, it cannot be executed. 


Why can't we remove this limitation? Is there a better way to migrate data?


Thanks.

Solr-7 CorruptIndexException: checksum failed (hardware problem?)

2020-08-04 Thread slly
Hello everyone, I use the version of Solr-7.7.3. 


The following error occurred during the index write phase, but after restarting 
the Solr service, the file was deleted, and access to the index has also been 
restored.


Has anyone ever encountered this mistake?




Caused by: org.apache.lucene.store.AlreadyClosedException: this IndexWriter is 
closed
at org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:680)
at org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:694)
at 
org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1613)
at 
org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1608)
at 
org.apache.solr.update.DirectUpdateHandler2.updateDocOrDocValues(DirectUpdateHandler2.java:969)
at 
org.apache.solr.update.DirectUpdateHandler2.doNormalUpdate(DirectUpdateHandler2.java:341)
at 
org.apache.solr.update.DirectUpdateHandler2.addDoc0(DirectUpdateHandler2.java:288)
at 
org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:235)
... 67 more
Caused by: org.apache.lucene.index.CorruptIndexException: checksum failed 
(hardware problem?) : expected=dd0fcc0f actual=2317b057 
(resource=BufferedChecksumIndexInput(_2g_Lucene50_0.tim))
at org.apache.lucene.codecs.CodecUtil.checkFooter(CodecUtil.java:419)
at 
org.apache.lucene.codecs.CodecUtil.checksumEntireFile(CodecUtil.java:526)
at 
org.apache.lucene.codecs.blocktree.BlockTreeTermsReader.checkIntegrity(BlockTreeTermsReader.java:309)
at 
org.apache.lucene.codecs.perfield.PerFieldPostingsFormat$FieldsReader.checkIntegrity(PerFieldPostingsFormat.java:339)
at 
org.apache.lucene.codecs.perfield.PerFieldMergeState$FilterFieldsProducer.checkIntegrity(PerFieldMergeState.java:271)
at org.apache.lucene.codecs.FieldsConsumer.merge(FieldsConsumer.java:96)
at 
org.apache.lucene.codecs.perfield.PerFieldPostingsFormat$FieldsWriter.merge(PerFieldPostingsFormat.java:164)
at 
org.apache.lucene.index.SegmentMerger.mergeTerms(SegmentMerger.java:231)
at org.apache.lucene.index.SegmentMerger.merge(SegmentMerger.java:116)
at 
org.apache.lucene.index.IndexWriter.mergeMiddle(IndexWriter.java:4482)
at org.apache.lucene.index.IndexWriter.merge(IndexWriter.java:4077)
at 
org.apache.solr.update.SolrIndexWriter.merge(SolrIndexWriter.java:224)
at 
org.apache.lucene.index.ConcurrentMergeScheduler.doMerge(ConcurrentMergeScheduler.java:625)
at 
org.apache.lucene.index.ConcurrentMergeScheduler$MergeThread.run(ConcurrentMergeScheduler.java:662)


Thanks.




 

A little confused about CoreContainer.replayUpdatesExecutor

2020-10-23 Thread slly
Hello everyone.


I'm a little confused:  replayUpdatesExecutor, only one thread is always 
running? 
OrderedExecutor limits the cfg.getReplayUpdatesThreads() number of tasks to be 
submitted, and the newMDCAwareCachedThreadPool thread queue are up to 
cfg.getReplayUpdatesThreads() queues, the thread poll corePoolSize is 0.


 
 CoreContainer.java
| this.replayUpdatesExecutor =newOrderedExecutor( |
| | cfg.getReplayUpdatesThreads(), |
| | ExecutorUtil.newMDCAwareCachedThreadPool( |
| | cfg.getReplayUpdatesThreads(), |
| | newSolrNamedThreadFactory("replayUpdatesExecutor"))); |
Thanks.