Lesson 2.1: Indexing at publish
With the shipped settings, Exponential updates the search index the moment content is published. This lesson shows learners what that means in practice: a draft is never found, a new version replaces the old words, and some operations need no reindexing at all.
At a glance
| Course | Search |
| Module | Module 2: Indexing |
| Duration | 25 minutes (10 presenting, 15 exercise) |
| Level | Intermediate |
| Audience | Site administrators and support staff |
| Prerequisites | Module 1; an administrator account on the training installation |
Learning objectives
After this lesson, learners can:
- explain that only published versions are indexed, never drafts;
- show that publishing a new version replaces the indexed words of the object;
- say which operations the built-in engine needs no index update for (move, hide, reveal, a new location);
- predict what a search finds after an item is moved to the trash.
Trainer's notes
How to present it
Source: 10.8 Search indexing and image handling and Publishing, versions and the trash.
- Publish indexes (3 minutes). The publish operation hands the object to the search engine, which removes its old words and adds the words of the new published version. A draft is not part of the index; only the published version is.
- What the built-in engine does not need (4 minutes). Show the table of chapter 10.8. For
eZSearchEnginea move, a new location, a swap, hiding and revealing queue nothing, because its index holds no paths: the engine checks locations and visibility when it searches. Solr keeps paths, so for ezfind those operations do update the index (Module 4). - Trash and delete (3 minutes). Moving to the trash or deleting removes the object from search; restoring it from the trash makes it findable again.
Common questions
I published and the item is not found. Why? With the shipped settings it is found at once. If not, the site may use delayed indexing (lesson 2.2), the searching user may not be allowed to read it, or the attribute that holds the word may not be searchable (lesson 2.4).
Are hidden items found? The engine filters hidden items when it searches, according to the siteaccess's visibility rules; on the public site they are not found.
Does a draft by another editor show up in my search? No. Drafts are listed under My drafts, not in search.
Pitfalls
- Testing with a word from the old version. Learners search for a word they just removed and are surprised it is gone. That is the point of the exercise: let them discover it.
- Delayed indexing switched on in the lab. If a previous class left
DelayedIndexing=enabled, nothing is found at once. Check the setting before the class (exp:ini get site.ini/SearchSettings/DelayedIndexing).
Hands-on exercise
Use your own training installation, signed in to the administration as an administrator.
- Below a folder of your own, press Create new, choose Article, and give it the title
Indexing test pear. Fill in the required fields with text that contains the wordorchard. - Press Store draft and exit instead of publishing. Search for
orchardwith the Search... field. - Open My drafts on the dashboard, continue the draft and press Send for publishing. Search for
orchardagain. - Press Edit on the article, replace the word
orchardwithgreenhouseeverywhere and publish. - Search for
orchard, then forgreenhouse. - Move the article to another folder (Move). Search for
greenhouse: is it still found, and with which path? - Press Remove on the article and confirm that it goes to the trash (do not delete it permanently). Search for
greenhouse. - Open the Trash, restore the article to its original location and search once more.
Expected result
- Step 2 finds nothing: the draft is not indexed.
- Step 3 finds the article at once.
- Step 5:
orchardfinds nothing,greenhousefinds the article (the new version replaced the words). - Step 6 finds it with its new path; nothing had to be reindexed.
- Step 7 finds nothing; step 8 finds it again.
- The trainer checks by asking one learner to show steps 5 and 7 on the projector.
Quiz
- True or false: a stored draft is found by the administration search.
- You publish version 3 of an article. Which words does the index hold for it afterwards? A. those of versions 1 to 3 B. those of version 3 only C. those of version 1 only D. none until the cronjob runs
- With the built-in engine, does moving an item require an index update? Why?
- What happens to search results when an item is moved to the trash?
- Name two reasons why a just-published item may not be found.
Answers
- False. Only published versions are indexed.
- B. Publishing replaces the object's indexed words with those of the new published version (with the shipped settings, without delayed indexing).
- No. Its index holds no paths; locations and visibility are checked when searching (10.8).
- It is no longer found; after a restore it is found again.
- Any two of: delayed indexing is on and the cronjob has not run; the user may not read it; the word is in an attribute that is not searchable; it is hidden.
Further reading
- 10.8 Search indexing and image handling: what each operation queues.
- Publishing, versions and the trash: versions and the trash for editors.
- Searching: what editors are told about new items in search.
Related pages
- Module 2: Indexing
- Search: course overview
- Trainers: start here
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.