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

[SPARK-33166][DOC] Provide Search Function in Spark docs site #30292

Closed
wants to merge 34 commits into from

Conversation

beliefer
Copy link
Contributor

@beliefer beliefer commented Nov 9, 2020

What changes were proposed in this pull request?

In the last few releases, our Spark documentation https://spark.apache.org/docs/latest/ becomes richer. It would nice to provide a search function to make our users find contents faster.

DocSearch is entirely free and automated. This PR will use it to provides search function.

The screenshots show below:
overview

Why are the changes needed?

Let the users of Spark documentation could find the needed information effectively.

Does this PR introduce any user-facing change?

Yes

How was this patch tested?

build on my machine and look on brower.

beliefer and others added 29 commits June 19, 2020 10:36
@github-actions github-actions bot added the DOCS label Nov 9, 2020
@SparkQA
Copy link

SparkQA commented Nov 10, 2020

Test build #130876 has finished for PR 30292 at commit 9c9d639.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 10, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35482/

@SparkQA
Copy link

SparkQA commented Nov 10, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35482/

@beliefer
Copy link
Contributor Author

@sarutak I cannot reproduce the two problems you mentioned on my Safari browser. It seems the css style is different. Could you pull and build with Jekyll again?
input

@sarutak
Copy link
Member

sarutak commented Nov 11, 2020

@beliefer I found the first issue isn't in the latest change. The second issue seems that we move to the online Spark document rather than local document.

Before move:
before_move

After move:
after_move

Is this intended?

@beliefer
Copy link
Contributor Author

beliefer commented Nov 11, 2020

@sarutak Because this PR not merged and not publish to the online Spark document.

@sarutak
Copy link
Member

sarutak commented Nov 11, 2020

@sarutak Because this PR not merged and not publish to the online Spark document.

Yes. But even if this is published, the search results consistently refer to the latest release at the time point.
Imagine that this feature is merged to 3.1 and then 3.2 is released in the future, and someone still uses Spark 3.1.
In that case, even though the user uses this feature for 3.1, the search result refer to the document for 3.2 right?

@beliefer
Copy link
Contributor Author

beliefer commented Nov 11, 2020

@sarutak Because this PR not merged and not publish to the online Spark document.

Yes. But even if this is published, the search results consistently refer to the latest release at the time point.
Imagine that this feature is merged to 3.1 and then 3.2 is released in the future, and someone still uses Spark 3.1.
In that case, even though the user uses this feature for 3.1, the search result refer to the document for 3.2 right?

If so, we should apply different id from docsearch when we ready release a new spark version. @gatorsmile

@sarutak
Copy link
Member

sarutak commented Nov 11, 2020

If so, we should apply different id from docsearch when we ready release a new spark version. @gatorsmile

Sounds good if we can do it.

@gengliangwang
Copy link
Member

gengliangwang commented Nov 11, 2020

@beliefer Thanks for the work!
I just tried the PR in my local setup. The element "Documentation" looks wired to me:

  • It is always with the same URL as the first search result.
  • I thought the rectangle outside the "Documentation" is an input text box but it is not.
    image

@gengliangwang
Copy link
Member

gengliangwang commented Nov 11, 2020

I just try removing the style from dosearch.css and it looks fine:
image

I don't think we can just copy the style from https://docsearch.algolia.com/docs/styling here

@gatorsmile
Copy link
Member

If so, we should apply different id from docsearch when we ready release a new spark version. @gatorsmile

Yes. This is true. We need to apply different ID for each new version.

@SparkQA
Copy link

SparkQA commented Nov 12, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35612/

@SparkQA
Copy link

SparkQA commented Nov 12, 2020

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35612/

@sarutak
Copy link
Member

sarutak commented Nov 12, 2020

retest this please.

@SparkQA
Copy link

SparkQA commented Nov 12, 2020

Test build #131016 has finished for PR 30292 at commit 7120c5b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 12, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35622/

@SparkQA
Copy link

SparkQA commented Nov 12, 2020

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35622/

@SparkQA
Copy link

SparkQA commented Nov 12, 2020

Test build #131005 has finished for PR 30292 at commit 7120c5b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@beliefer
Copy link
Contributor Author

@gengliangwang I resolved the issue you said.

@sarutak
Copy link
Member

sarutak commented Nov 13, 2020

Seems good to me.

Copy link
Member

@gengliangwang gengliangwang left a comment

Choose a reason for hiding this comment

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

LGTM

@gengliangwang
Copy link
Member

Thanks, merging to master

@beliefer
Copy link
Contributor Author

@gengliangwang @sarutak @gatorsmile @maropu @HyukjinKwon Thanks for your help!

maropu pushed a commit that referenced this pull request Nov 19, 2020
### What changes were proposed in this pull request?

Make the API key of DocSearch configurable and avoid hardcoding in the HTML template

### Why are the changes needed?

After #30292, our Spark documentation site supports searching.
However, the default API key always points to the latest release doc. We have to set different API keys for different releases. Otherwise, the search results are always based on the latest documentation(https://spark.apache.org/docs/latest/) even when visiting the documentation of previous releases.

As per discussion in #30292 (comment), we should make the API key configurable and set different values for different releases.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Manual test

Closes #30409 from gengliangwang/apiKey.

Authored-by: Gengliang Wang <gengliang.wang@databricks.com>
Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org>
maropu pushed a commit that referenced this pull request Nov 24, 2020
…lts by version

### What changes were proposed in this pull request?

In the discussion #30292 (comment), we planned to apply a new API key for each Spark release. However, it turns that DocSearch supports crawling multiple URLs from one website and filtering by fact key: https://docsearch.algolia.com/docs/config-file/#using-regular-expressions

Thanks to the help from shortcuts, our Spark doc supports multiple version now: algolia/docsearch-configs#2868

This PR is to add the fact key in the search script and update the instruction in the comment.

### Why are the changes needed?

To support filtering Spark documentation search results by the current document version.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Manual test

Closes #30469 from gengliangwang/apiKeyFollowUp.

Authored-by: Gengliang Wang <gengliang.wang@databricks.com>
Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
7 participants