#7376 closed enhancement (fixed)
searching published worksheets does not work to just search for username
Reported by: | jason | Owned by: | boothby |
---|---|---|---|
Priority: | minor | Milestone: | sage-4.3 |
Component: | notebook | Keywords: | |
Cc: | was | Merged in: | sagenb-0.4.6 |
Authors: | Mitesh Patel | Reviewers: | William Stein |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
It would be really nice if the "Search" function in the upper left of the published worksheet listing also searched for the username (e.g., I could search for "jason3" and get all of my published worksheets).
Attachments (2)
Change History (9)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
It seems this will work:
-
sagenb/notebook/worksheet.py
diff --git a/sagenb/notebook/worksheet.py b/sagenb/notebook/worksheet.py
a b class Worksheet(object): 1973 1973 """ 1974 1974 # Load the worksheet data file from disk. 1975 1975 filename = self.worksheet_html_filename() 1976 r = (self. owner().lower() + ' ' + self.name().lower() + ' '1976 r = (self.publisher().lower() + ' ' + self.name().lower() + ' ' 1977 1977 + open(filename).read().lower()) 1978 1978 # Check that every single word is in the file from disk. 1979 1979 for W in split_search_string_into_keywords(search):
comment:3 Changed 11 years ago by
But:
sage: from sagenb.notebook.worksheet import split_search_string_into_keywords as ss sage: ss('hello there') ['hello', 'there'] sage: ss(" foo bar 'modular form' hello there") ['modular form', "'", 'hello', 'there']
Pyparsing is another alternative. There's a search query parser among the examples. The license appears to be a modified-BSD license.
Should we add modifiers? For example, the search phrase "Fourier user:joe
would restrict the search to worksheets published by Joe. Other possible modifiers: title
, text_cell
, compute_cell
, dates
, input
, output
, collaborators
, rating
.
Changed 11 years ago by
Alternate version: Search by owner and publisher. Apply only this patch to sagenb repo.
comment:4 Changed 11 years ago by
- Status changed from new to needs_review
Should we do more with this ticket?
comment:5 Changed 11 years ago by
- Report Upstream set to N/A
- Status changed from needs_review to positive_review
Nice; this works as advertised.
I like all the discussion above about even more sophisticated searching systems, but of course they shouldn't hold up this ticket getting a... positive review!
comment:6 Changed 11 years ago by
- Resolution set to fixed
- Status changed from positive_review to closed
I merged this patch into sagenb-0.4.6.
comment:7 Changed 11 years ago by
- Merged in set to sagenb-0.4.6
- Reviewers set to William Stein
We should also consider supporting more complex queries, e.g., on an "Advanced Search" page. By the way, according to codenode-devel, Codenode uses Whoosh for full-text search.