-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Reapply the Elastic Search upgrade to master
#4722
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
6a451ec
Reapply search upgrade to master.
ericholscher 14a1c66
Remove hacked return value for testing
ericholscher 2e36570
index project asynchronously
safwanrahman d2607e0
Merge pull request #5023 from safwanrahman/async_project
ericholscher ab023f7
Update docembed
ericholscher dbbd240
Merge remote-tracking branch 'origin/master' into search-reapply
ericholscher 7308daf
Fix merge syntax
ericholscher 12de58b
Don't do two searches
ericholscher 46c4f20
Merge remote-tracking branch 'origin/master' into search-reapply
ericholscher 60714be
Lint search branch
ericholscher c8adfb4
Fix env
ericholscher 2d28826
Fix lint issues
ericholscher bb4db91
Update migration name
ericholscher 61f3d3b
Merge remote-tracking branch 'origin/master' into search-reapply
ericholscher e289926
Adjust shards & replicas to use less memory
ericholscher 9370e20
Remove test that was testing deleted code
ericholscher 1ebe494
Properly use the HTML encoder on searches.
ericholscher 2063d2d
Add an XSS test
ericholscher 75c4ae3
Index HTMLDir projects properly
ericholscher 46bc58f
HTMLDir excluded files
ericholscher f6523d4
Don't exclude all pages based on name
ericholscher 02741ba
Remove hack doing only OR
ericholscher 7d0e58c
Fix test
ericholscher 444da14
New object syntax
ericholscher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,26 @@ | ||
import pytest | ||
|
||
from readthedocs.search.documents import PageDocument | ||
|
||
|
||
@pytest.mark.django_db | ||
@pytest.mark.search | ||
class TestXSS(object): | ||
|
||
def test_facted_page_xss(self, client, project): | ||
query = 'XSS' | ||
page_search = PageDocument.faceted_search(query=query) | ||
results = page_search.execute() | ||
expected = """ | ||
<h3><em>XSS</em> exploit</h3> | ||
""".strip() | ||
assert results[0].meta.highlight.content[0][:len(expected)] == expected | ||
|
||
def test_simple_page_xss(self, client, project): | ||
query = 'XSS' | ||
page_search = PageDocument.simple_search(query=query) | ||
results = page_search.execute() | ||
expected = """ | ||
'<h3><em>XSS</em> exploit</h3> | ||
""".strip() | ||
assert results[0].meta.highlight.content[0][:len(expected)] == expected |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to inheritance from object anymore