Comments (6)
Thanks @marcopacurariu3 , we'll work on reproducing this today and will report back to you.
from java-client-api.
Great @rjrudin, thank you!
from java-client-api.
@marcopacurariu3 I haven't had luck reproducing this yet. I added a new JUnit test - acb5085#diff-52e216474c59fcf9a974f2706e674b08ef0c484eee84fb74a7839b0439c99bd5R186 - that does the following:
- Adds the same XML doc with different URIs to collections
test1
andtest2
. - Verifies that a regular structured and-not query (with a term-query on "world", which is in both documents) works.
- Verifies that a combined and-not-query works.
- Verifies that the same combined and-not-query works with DMSDK.
I also verified that if I comment out the and-not query, then the test fails as it returns 2 documents instead of only 1.
So the and-not-query appears to be getting picked up in all cases.
Could you try modifying your query to do a term-query instead of a range-constraint-query? Looks like you could just do a term-query on "testapp". Perhaps the issue requires the use of both a range query and a set of search options.
from java-client-api.
Sure, I will play around and come back to you tomorrow.
Thanks a lot for digging into it.
from java-client-api.
@rjrudin, thanks once again for the implemented test. This helped me finding out the real issue. It works with range-constraing-query in your example, too, so it's not that.
The issue is that I am using "positive/negative" instead of "positive**-query**/negative**-query**".
So, "positive" works in a simple search, but it does not work in QueryBatcher. The QueryBatcher supports only "positive-query" or "negative-query".
Here is the query that for me it works in search, but not in batcher:
"<search xmlns=\"http://marklogic.com/appservices/search\">\n" +
" <query>\n" +
" <and-query>\n" +
" <range-constraint-query>\n" +
" <constraint-name>application</constraint-name>\n" +
" <value>testapp</value>\n" +
"<range-operator>EQ</range-operator>\n" +
" </range-constraint-query>\n" +
" <and-not-query>\n" +
" <positive>\n" +
" <collection-query>\n" +
" <uri>test1</uri>\n" +
" </collection-query>\n" +
" </positive>\n" +
" <negative>\n" +
" <collection-query>\n" +
" <uri>test2</uri>\n" +
" </collection-query>\n" +
" </negative>\n" +
" </and-not-query>\n" +
" </and-query>\n" +
" </query>\n" +
"</search>"
I assume that if you do the same in your test, then you will notice the issue.
from java-client-api.
Hi @marcopacurariu3 - I checked the docs for a structured and-not-query - https://docs.marklogic.com/guide/search-dev/structured-query#id_65108 - and it does require positive-query
and negative-query
. I'm a little surprised the server doesn't reject positive
and negative
but rather ignores it.
I'm not sure why your query would work with positive
and negative
as I'm fairly certain those should always be ignored. I verified in my test that if I use those element names, the test fails.
I think the right approach here is to use positive-query
and negative-query
per the server docs link above. I'm going to close this, but please let me know if you run into issues with those elements working.
from java-client-api.
Related Issues (20)
- DMSDK has troubles with tiered storage offline HOT 8
- Transfer Encoding has non-emtpy body when no result in returned through okhttp HOT 3
- op.sampleBy misses the 0 parameter overloaded method HOT 1
- Delete temporal documents via DMSDK HOT 2
- Specifi page length and startIndex for dataMOvementManager using newQueryBatcher HOT 3
- Upgrade to jackson-databind 2.14.0 when available HOT 2
- WriteBatcher does not write documents when total documents provided is less than 100 and without using withBatchSize HOT 1
- SparQL query throws unexpected error HOT 3
- Executing PatchHandle against non-existing Document does not throw an Exception HOT 5
- Incorrectly return empty query result HOT 3
- Support for Java 17? HOT 8
- Numbers returned by MarkLogic do not use scientific notation HOT 1
- Implementations of innerSerialize lack proper namespace HOT 11
- Feature Request: OptimisticLockingExecption HOT 7
- Request for Jakarta EE 10 compliant version HOT 18
- Remove "ML-Check-ML11-Headers" for ML11 java client api HOT 1
- Directory queries allow for invalid values of "depth" without throwing an error HOT 3
- Wrong timeout conversion in awaitCompletion HOT 4
- queryManager.uris does not honor additional-query in search options HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-client-api.