forked from sphinx-doc/sphinx
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve relevance scoring in HTML search results (sphinx-doc#12441)
Co-authored-by: Will Lachance <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
- Loading branch information
1 parent
e7beb8b
commit 91c5cd3
Showing
8 changed files
with
132 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import os | ||
import sys | ||
|
||
sys.path.insert(0, os.path.abspath('.')) | ||
|
||
extensions = ['sphinx.ext.autodoc'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Main Page | ||
========= | ||
|
||
This is the main page of the ``titles`` test project. | ||
|
||
In particular, this test project is intended to demonstrate how Sphinx | ||
can handle scoring of query matches against document titles and subsection | ||
heading titles relative to other document matches such as terms found within | ||
document text and object names extracted from code. | ||
|
||
Relevance | ||
--------- | ||
|
||
In the context of search engines, we can say that a document is **relevant** | ||
to a user's query when it contains information that seems likely to help them | ||
find an answer to a question they're asking, or to improve their knowledge of | ||
the subject area they're researching. | ||
|
||
.. automodule:: relevance | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class Example: | ||
"""Example class""" | ||
num_attribute = 5 | ||
text_attribute = "string" | ||
|
||
relevance = "testing" | ||
"""attribute docstring""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Relevance | ||
========= | ||
|
||
In some domains, it can be straightforward to determine whether a search result | ||
is relevant to the user's query. | ||
|
||
For example, if we are in a software programming language domain, and a user | ||
has issued a query for the term ``printf``, then we could consider a document | ||
in the corpus that describes a built-in language function with the same name | ||
as (highly) relevant. A document that only happens to mention the ``printf`` | ||
function name as part of some example code that appears on the page would | ||
also be relevant, but likely less relevant than the one that describes the | ||
function itself in detail. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters