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

[DOCS] Reformat match phrase prefix query #45209

Merged
merged 4 commits into from
Aug 6, 2019
Merged

Conversation

jrodewig
Copy link
Contributor

@jrodewig jrodewig commented Aug 5, 2019

Updates the match_phrase_prefix query to use the new query format.

This creates separate sections for the example request, parameters, and notes.

This is part of #40977, an effort to standardize documentation for query types.

Preview

http://elasticsearch_45209.docs-preview.app.elstc.co/guide/en/elasticsearch/reference/master/query-dsl-match-query-phrase-prefix.html

@jrodewig jrodewig added >docs General docs changes :Search/Search Search-related issues that do not fall into other categories v8.0.0 v7.0.2 v7.1.2 v7.4.0 v7.3.1 v7.2.2 labels Aug 5, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs

Copy link
Contributor

@mayya-sharipova mayya-sharipova left a comment

Choose a reason for hiding this comment

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

@jrodewig Thanks, nice reorganization!

[[match-phrase-prefix-query-ex-request]]
==== Example request

The following search returns documents that phrases beginning with `quick brown
Copy link
Contributor

Choose a reason for hiding this comment

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

documents that phrases -> documents that contain phrases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed with 8f391fa.

==== Notes

[[match-phrase-prefix-autocomplete]]
===== Avoid using the match phrase prefix query for search autocompletion
Copy link
Contributor

Choose a reason for hiding this comment

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

I think "avoid" is a strong word here. I would rather say "Prefer not using". Because for some use cases (for a quick start etc), it is a valid use case.

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've changed this heading to "Using..." with bb2e045. This will make the nuance of that use case a bit more clear and encourage users to read the block.

While easy to set up, using the `match_phrase_prefix` query for search
autocompletion can sometimes produce confusing results.

For example, consider the query string `quick brown f`. This query works by
Copy link
Contributor

Choose a reason for hiding this comment

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

f`. This

brown). Then

nit: are there two spaces after .?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Fixed with 91cfead.

@jrodewig
Copy link
Contributor Author

jrodewig commented Aug 6, 2019

Thanks @mayya-sharipova.

@jrodewig jrodewig merged commit 1cc4aa1 into master Aug 6, 2019
@jrodewig jrodewig deleted the match-phrase-prefix-query branch August 6, 2019 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>docs General docs changes :Search/Search Search-related issues that do not fall into other categories v7.0.2 v7.1.2 v7.2.2 v7.3.1 v7.4.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants