marklogic / marklogic/java-client-api

queryManager.uris does not honor additional-query in search options

Ouverte
#1,643 7 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

server-bug
Langage dominant
Java
Étoiles
61
Forks
74
Merge moyen
2 j 53 min
PR mergées (30 j)
8

Description

Version of MarkLogic Java Client API

6.5.0

Version of MarkLogic Server

11.0.2

Java version

JDK 17

OS and version

ProductName: macOS
ProductVersion: 13.5
BuildVersion: 22G74

Input: Some code to illustrate the problem, preferably in a state that can be independently reproduced on our end

The current issue is a follow-up of this one: https://github.com/marklogic/java-client-api/issues/1640

In the last issue you correctly mentioned that the correct format for search positive/negative is: positive-query and negative-query

However, the way I created the last issue is not 1:1 with the issue that we actually had. Our issue is actually the following:
executing a search query and passing an options name parameter (where the options contains an and-not-query looking for a collection is simply ignored in QueryBatcher, but it works for a simple search).

Let me help you a bit with a piece of code:

QueryManager queryManager= markLogicDatabaseClient.newQueryManager();
        final RawCombinedQueryDefinition structQueryDef = queryManager
            .newRawCombinedQueryDefinition(new StringHandle(
                "<search xmlns=\"http://marklogic.com/appservices/search\">\n" +
			"  <query>\n" +
			"    <and-query>\n" +
			"      <term-query>\n" +
			"        <text>world</text>\n" +
			"      </term-query>\n" +
			"    </and-query>\n" +
			"  </query>\n" +
			"</search>"), "all");

        final SearchHandle result = queryManager.search(structQueryDef, new SearchHandle());
        result.getMatchResults();

The content of "all.xml" contains (between other stuff):

<cts:and-not-query>
	  <cts:annotation type="searchable-collections"/>
	  <cts:positive>
	    <cts:collection-query>
	      <cts:uri>collection1</cts:uri>
	      <cts:uri>collection2</cts:uri>
	    </cts:collection-query>
	  </cts:positive>
	  <cts:negative>
	      <cts:collection-query>
		<cts:uri>ignoredCollection</cts:uri>
	      </cts:collection-query>
	  </cts:negative>
	</cts:and-not-query>
Actual output: What did you observe? What errors did you see? Can you attach the logs? (Java logs, MarkLogic logs)

The output is correct for a simple search, the collections are filtered, but for QueryBatcher they are not.

Expected output: What specifically did you expect to happen?

The output is the same for both search and QueryBatcher (collections are taken into account)

Alternatives: What else have you tried, actual/expected?

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par les points d’entrée QueryManager.search et QueryBatcher, en utilisant la reproduction Java fournie ainsi que le contenu des options de all.xml. Comparez la manière dont le nom de l’option et son filtre de collection and-not-query sont appliqués dans une recherche simple par rapport à QueryBatcher. Le travail est terminé lorsque les deux chemins renvoient les mêmes résultats filtrés par collection, y compris l’exclusion de ignoredCollection.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
databases
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
52/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.