It may also include major headings, and many also index the words in the first 20 or so lines of the item. This gives you a better chance of finding the item you want. There is no exact number of words to choose. But there are a couple of guidelines. Use unique words and their abbreviations and their synonyms.
More words mean less documents.
If you're looking for something very specific, use a lot of terms. If you want to retrieve a lot of items, use less words. ANDs and ORs- Boolean Logical Operators Search engines use boolean operators. These are ways the database searches for the items you typed in. This can make a huge difference in your search results.