organice
organice copied to clipboard
Expand search: text in description
Continuation of the discussion in #504
Should descriptions only be searched when explicitly queried with a search term like desc:
like for timestamps or should their text be a part of regular word search?
Should the raw description be used for search or should only certain parts ( as in header.get('description').filter(d=>d.get('type')==='text')
) be used?
Thanks for already tackling the next issue^^
Should descriptions only be searched when explicitly queried with a search term like desc: like for timestamps or should their text be a part of regular word search?
The former.
Should the raw description be used for search or should only certain parts ( as in header.get('description').filter(d=>d.get('type')==='text')) be used?
The latter.
Should the raw description be used for search or should only certain parts ( as in header.get('description').filter(d=>d.get('type')==='text')) be used?
The latter.
Are you sure @munen? E.g. *bold*
would not be found then – which is arguably OK.
But what is with this query:
desc:"two words"
when the actual text is two *words*
?
IMO it would be best to match header.get('descriptionAsPlainText')
or just header.get('rawDescription')
... the first doesn't exist though.
Are you sure @munen?
Apologies. I had some memory of rawDescription
including all the other metadata (like
PROPERTIES and planning items) which is just a wrong memory:
With the current data we have, searching in rawDescription
is likely the best. To get around the markup issue you mentioned, we could exclude the common markup (‘bold’, ‘/italic/’, ‘underlined’, ‘=verbatim=’ and ‘~code~’, ‘+strike-through+’.) in search.
Quick'n'dirty POC:
munen@lambda:~% node
> 'two *words*'.replace(/\*([\w]*)\*/, (match, p1, offset, string) => p1).match(/two words/)
[ 'two words', index: 0, input: 'two words', groups: undefined ]
Thank you for double checking on me, @schoettl!
I would find this feature very useful, was there any progress?
was there any progress?
Yes! There's a volunteer for the issue at hand. @neildavidforrest, would you like to take over implementation? I'm happy to help with testing and documentation.
Sure I can give it a shot. It will take me a while to get up to speed, but the information in https://github.com/200ok-ch/organice/pull/505 seems very useful.
Sure I can give it a shot. It will take me a while to get up to speed, but the information in https://github.com/200ok-ch/organice/pull/505 seems very useful.
@neildavidforrest #505 is certainly a good place to have a look into how the search setup is implemented. There's also a bit of documentation to get you started from the top: https://organice.200ok.ch/documentation.html#search_grammar
Good luck and have fun!
I have a proof of concept version working locally, I will try to put a PR together soon after some further refinement. For example I have not yet implemented the filtering of markup characters described above.
A useful extension to this might be to show a preview of the matched text in the search results, as currently you only see the headline text, so it is difficult to appreciate the context of the match (and clicking the result to see the context will reset your search).
But one thing at a time...
@munen Please see https://github.com/200ok-ch/organice/pull/907, thank you.
Closed by https://github.com/200ok-ch/organice/pull/907
Thank you, @neildavidforrest :pray: :bow: