Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4907 Tweaked advanced search documentation to include new search operators #4909

Conversation

albertisfu
Copy link
Contributor

Fixes: #4907

Included & operator to AND documentation.
Screenshot 2025-01-10 at 6 10 37 p m

Added But not documentation
Screenshot 2025-01-10 at 6 11 12 p m

Tweaked the Wildcards documentation to reflect the new behavior of * and ! and updated fuzzy search documentation according to ES behaviour:
Screenshot 2025-01-10 at 6 11 34 p m

Added documentation about disallowed expensive wildcard patterns:
Screenshot 2025-01-10 at 6 13 15 p m

Linked disallowed expensive wildcard error message to documentation:
Screenshot 2025-01-10 at 6 15 26 p m

Fixed the /s and /p syntax error message to correctly refer to a proximity query example instead of a fuzzy query, as it did previously.

Screenshot 2025-01-10 at 6 16 19 p m

@albertisfu albertisfu requested a review from mlissner January 11, 2025 00:18
Copy link
Member

@mlissner mlissner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. A couple little things, but I'm happy to see our documentation advancing lockstep with our enhancements.

@@ -34,7 +34,7 @@ <h2 class="alt">
{% elif error_message == "unbalanced_quotes" %}
Did you forget to close one or more quotes?
{% elif error_message == "disallowed_wildcard_pattern" %}
The query contains a disallowed expensive wildcard pattern.
The query contains a <a href="{% url "advanced_search" %}#disallowed-expensive-wildcards">disallowed expensive wildcard</a> pattern.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think most people understand what it means to be an "expensive" wildcard, so, I suggest:

Suggested change
The query contains a <a href="{% url "advanced_search" %}#disallowed-expensive-wildcards">disallowed expensive wildcard</a> pattern.
The query contains a <a href="{% url "advanced_search" %}#disallowed-expensive-wildcards">disallowed wildcard</a> pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, removed expensive. Also removed from the API error message.


<p>The question mark character (<strong>?</strong>) can be used similarly as a single letter wildcard. For example, this would find cases containing the word "immigrant" or "emmigration": <code>?mmigra*</code>
</p>
<p><code>*</code> can also be used inside words, where it acts as a single-character wildcard. For example, a query like <code>gr*mm*r</code> would match cases containing both "gr<strong>a</strong>mm<strong>a</strong>r" and "gr<strong>i</strong>mm<strong>e</strong>r".</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need <nobr>'s here, right?

Suggested change
<p><code>*</code> can also be used inside words, where it acts as a single-character wildcard. For example, a query like <code>gr*mm*r</code> would match cases containing both "gr<strong>a</strong>mm<strong>a</strong>r" and "gr<strong>i</strong>mm<strong>e</strong>r".</p>
<p><code>*</code> can also be used inside words, where it acts as a single-character wildcard. For example, a query like <nobr><code>gr*mm*r</code></nobr> would match cases containing both <nobr>"gr<strong>a</strong>mm<strong>a</strong>r"</nobr> and <nobr>"gr<strong>i</strong>mm<strong>e</strong>r"</nobr>.</p>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that <nobr> is deprecated and is no longer recommended for use.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nobr

Instead used text-nowrap css class.


<p>Queries that match multiple endings are only allowed if the base word has at least three characters. Therefore, queries like <code>a*</code>, <code>bc*</code>, <code>!a</code>, or <code>!bc</code> are disallowed due to performance issues.</p>
<p>Performing a query like these will throw an error with the message:</p>
<p><code>The query contains a disallowed expensive wildcard pattern.</code></p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p><code>The query contains a disallowed expensive wildcard pattern.</code></p>
<p><code>The query contains a disallowed wildcard pattern.</code></p>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed. Also from the section title, now just Disallowed Wildcards

@albertisfu
Copy link
Contributor Author

Thanks! Suggestions applied.

Copy link
Member

@mlissner mlissner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mlissner mlissner merged commit f8645e7 into 3888-support-additional-search-connectors Jan 13, 2025
7 checks passed
@mlissner mlissner deleted the 4907-document-new-search-operators branch January 13, 2025 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants