Commit Graph

162 Commits

Author SHA1 Message Date
Daniel Lockyer
a18da88073
Added .yarnrc config to Sodo-Search
refs https://github.com/TryGhost/Toolbox/issues/400

- this allows the git tag and commit to be correctly formed for new
  Sodo-Search releases
2023-03-17 10:41:47 +01:00
Daniel Lockyer
2c72f3c97b
Merged Sodo-Search gitignore with top-level one
refs https://github.com/TryGhost/Toolbox/issues/400

- we don't need multiple gitignores because it can produce weird
  behaviour with some tools
2023-03-17 10:34:21 +01:00
Daniel Lockyer
94201281e3
Updated lockfile 2023-03-17 10:32:28 +01:00
Daniel Lockyer
3f3cf76c37 Updated react-scripts to v5
refs https://github.com/TryGhost/Toolbox/issues/400

- this fixes various build issues when it's moved into the Ghost
  monorepo
2023-03-17 09:52:12 +01:00
Rishabh
53af8d8243 v1.1.0 2022-07-25 22:29:57 +05:30
Rishabh Garg
ceebcbd645 Updated hardcoded styles url to use config instead (#2)
refs https://github.com/TryGhost/Team/issues/1719

- the stylesheet link was hardcoded in the app, which made it impossible to configure if config changed in Ghost
- fetches styles url from the data attribute on script instead, which allows app to load styles based on config in Ghost
2022-07-25 22:23:09 +05:30
Rishabh
b8be0bbb2e v1.0.2 2022-07-19 11:37:59 +05:30
Rishabh
9fc0cd7e29 🐛 Fixed search failing for posts without excerpt
- the excerpt was `null` in some cases when post didn't have any excerpt, causing search to fail
2022-07-19 11:37:20 +05:30
Rishabh
a1fab8c7f7 v1.0.1 2022-07-13 07:37:44 +05:30
Rishabh
265d6058f2 🐛 Fixed internal css leaking outside for search
refs https://github.com/TryGhost/Team/issues/1675
closes https://github.com/TryGhost/Ghost/issues/15020

- the main css file used for search was accidentally imported in the root js script, causing it to be included alongside the final minified bundle and get injected outside the iframe.
- the main css is pushed as a separate file outside of bundle and used directly as link inside the iframe instead
2022-07-13 07:36:47 +05:30
Rishabh
e768477dfd v1.0.0 2022-07-12 16:55:28 +05:30
Sanne de Vries
838f4d0c0e Updated copy 2022-07-12 12:16:46 +01:00
Rishabh
22a639f263 v0.1.7 2022-07-09 14:09:13 +02:00
Rishabh
9391b31635 Fixed eslint error for regex templating
refs https://github.com/TryGhost/Team/issues/1665
refs https://github.com/babel/babel-eslint/issues/681

- eslint throws error on using template string with regex due to a bug, this changes the way regex is generated by string addition instead
2022-07-09 14:08:10 +02:00
Rishabh
4d0026deb6 Updated highlighting for excerpts
refs https://github.com/TryGhost/Team/issues/1665

- updates highlight logic for excerpts to show the right text
- breaks highlights by individual words instead of search sentence
2022-07-09 13:50:43 +02:00
Rishabh
ca4b5c6ed1 v0.1.6 2022-07-08 12:27:35 +02:00
Rishabh
f94582225c Disabled background scroll on search
refs https://github.com/TryGhost/Team/issues/1665

- disables background scroll on main page when search is opened to avoid scroll leak
2022-07-08 12:05:02 +02:00
Rishabh
eb59bea5c7 Removed author and tag sections with invalid urls
refs https://github.com/TryGhost/Team/issues/1665

- if taxonomy is disabled, author and tag urls are 404s.
- removes author/tag section if 404
2022-07-08 11:32:57 +02:00
Sanne de Vries
64bb0b3c50 Truncated search placeholder on mobile 2022-07-08 11:04:59 +02:00
Rishabh
4fdeb02b55 v0.1.5 2022-07-08 10:59:47 +02:00
Rishabh
a9b3265d12 Added loader for indexing
refs https://github.com/TryGhost/Team/issues/1665

- adds loading indicator while search index is setup from site data
2022-07-08 10:58:56 +02:00
Rishabh
604cde2633 Disabled keyboard shortcut for missing data attributes
refs https://github.com/TryGhost/Team/issues/1665

- in case no data-ghost-search attributes on a site, the keyboard shortcut to enable search is disabled
- allows site owners to completely disable search on their site
2022-07-08 10:47:36 +02:00
Rishabh
f722cab8b5 Removed merge error
refs https://github.com/TryGhost/Team/issues/1665
2022-07-08 10:46:22 +02:00
Rishabh
1e57af8fdd Moved fetching site data to first load of search popup
refs https://github.com/TryGhost/Team/issues/1665

- previously the search was loading site data on load for indexing, which adds unnecessary load if search is not used
- moves data fetch and indexing to when the search popup is opened first time avoiding unnecessary fetch
2022-07-08 10:39:41 +02:00
Rishabh
c30cb19650 Removed dummy data
refs https://github.com/TryGhost/Team/issues/1665

- removes dummy data for tests
2022-07-08 10:39:38 +02:00
Djordje Vlaisavljevic
5ade92c78d Added the loading state 2022-07-08 10:30:35 +02:00
Djordje Vlaisavljevic
b72bd2c85c Added the loading icon 2022-07-08 10:30:35 +02:00
Sanne de Vries
8167a9649b Updated highlighted keywords in result titles 2022-07-08 10:18:36 +02:00
Naz
13d4749949 Fixed internal tags showing up in the search results
refs https://github.com/TryGhost/Team/issues/1665

- By default we don't want to show internal tags in search results
2022-07-08 09:34:13 +02:00
Rishabh
233a1c2e4c v0.1.4 2022-07-07 17:08:17 +02:00
Sanne de Vries
6487c00f21 Improved search modal animation 2022-07-07 17:00:48 +02:00
Rishabh
6a8f1bd4dc Fixed invalid text data in highlighting
refs https://github.com/TryGhost/Team/issues/1665

- fixes crash on missing text string when highlighting
2022-07-07 16:43:05 +02:00
Sanne de Vries
cac01cb24b Updated clear search icon 2022-07-07 16:39:59 +02:00
Sanne de Vries
504e0b7446 Added cancel button to mobile view 2022-07-07 16:36:51 +02:00
Djordje Vlaisavljevic
790b34fc6c Updated spacing on smaller screens 2022-07-07 16:36:16 +02:00
Djordje Vlaisavljevic
f63d550f9c Made the search icon switch to clear button 2022-07-07 16:17:53 +02:00
Djordje Vlaisavljevic
c20b0bfa35 Removed unnecessary icons 2022-07-07 16:17:53 +02:00
Djordje Vlaisavljevic
61e5223885 Added a new clear button 2022-07-07 16:17:53 +02:00
Djordje Vlaisavljevic
a81777b987 Made the animation slightly faster 2022-07-07 16:17:53 +02:00
Rishabh
9678922357 v0.1.3 2022-07-07 16:09:49 +02:00
Rishabh
e4213a223d Added search highlight on title and excerpt
refs https://github.com/TryGhost/Team/issues/1665

- adds bold highlight for search term for title and excerpt
- needs logic to truncate to show excerpt highlight if it cuts out
2022-07-07 16:08:31 +02:00
Rishabh
70cbf57f35 v0.1.2 2022-07-07 15:18:43 +02:00
Djordje Vlaisavljevic
aede4046d8 Removed the outline in Safari 2022-07-07 14:43:08 +02:00
Rishabh
86cba694c2 Added pagination to post results
refs https://github.com/TryGhost/Team/issues/1665

- adds pagination for large post data sets using show more button
2022-07-07 14:40:45 +02:00
Naz
fc264e4108 Switched tokenization in search index
refs https://github.com/TryGhost/Team/issues/1665

- The search should support partial forward lookup to match `foobar` when `fo` or `foob` is typed.
- More about the matching mechanism here: https://github.com/nextapps-de/flexsearch#tokenizer-prefix-search
2022-07-07 14:27:04 +02:00
Naz
32a36057a9 Fixed test for search index
no issue

- The tests had to be updated to match the shape of updated resource queries (limits, ordering, etc.)
2022-07-07 14:22:07 +02:00
Naz
089edbc39c Added 10k limit to resource queries
refs https://github.com/TryGhost/Team/issues/1665

- When requesting 'all' resource the search could experience significant performance degradation and would be unresponsive when there are large amounts of posts/tags/authors on the site
- The limit of 10 000 records was chosen as a stopgap solution for experiments in live environment. Once we verify this limit is not causing much trouble, we could increase it if neede
2022-07-07 12:58:41 +02:00
Naz
ec68dc303c Removed plaintext formats from posts request
refs https://github.com/TryGhost/Team/issues/1665
refs https://github.com/TryGhost/Ghost/issues/10396

- Content API has been updated to return clean results for `excerpt` without require a hacky "&formats=plaintext" parameter
2022-07-07 12:55:08 +02:00
Naz
df3d6cee74 Swapped elasticlunr with flexsearch
refs https://github.com/TryGhost/Team/issues/1665

- elasticlunr in an abandoned package with quite a lot of security vulnerabilities. it also has worse performance memory/processing wise comparing to flexsearch (benchmark: https://nextapps-de.github.io/flexsearch/bench/)
- fusejs was another option that was consideres. it was not chosed due to it's poor performance.
2022-07-07 12:52:09 +02:00
Naz
11f7e89ee3 Added missing tagsIndex initialization
refs https://github.com/TryGhost/Team/issues/1665

- It is not striclty necessary for the tagsIndex declaration to be in the constructor, but it gives a very clear indication of which variables are a part of the class.
2022-07-07 12:52:08 +02:00