Skip to content

Commit

Permalink
fix doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelliao committed Jan 13, 2024
1 parent 14c7bb2 commit 904c2b0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ When we use AJAX to dynamically load parts of a page, we often use `innerHTML` t
document.getElementById('child').innerHTML = `<p>Hello, this is a dynamic page.</p>`;
```

However, when using `innerHTML``, if the loaded HTML fragment contains `<script>` tags, the browser will not execute the JavaScript:
However, when using `innerHTML`, if the loaded HTML fragment contains `<script>` tags, the browser will not execute the JavaScript:

```javascript
document.getElementById('child').innerHTML = `
Expand Down
4 changes: 0 additions & 4 deletions source/blogs/tech/2024-01-04-flex-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
There are several ways to add a full text search for a website:

1. Using in-site search, such as using Google to search `xyz site:example.com`. The disadvantage is that it is not real-time;

2. Using Elastic Search, which needs a dedicated server, and usually 3 nodes if using cloud service, very expensive;

3. Using Redisearch, which needs a Redis server with plugin, and additional development work.

For small and medium-sized web sites, the number of pages that need to be indexed is not large, it is possible to use a pure JavaScript based search engine to build the index, and provides real-time search.
Expand Down Expand Up @@ -126,9 +124,7 @@ This implementation makes English, French, German, Russian, Chinese, Japanese, a
The above word segmentation algorithm is simple and straightforward, but it still has shortcomings:

1. Chinese word segmentation is not implemented because we do not have a dictionary;

2. Lexical conversion of English words is not implemented because there is no thesaurus;

3. Both English and Chinese stop words are not implemented because there is still no vocabulary library.

However, considering that a feature-rich front-end search is implemented in just a few lines of code, the profit is really high, so let’s call it a day!

0 comments on commit 904c2b0

Please sign in to comment.