Version at: 05/05/2014, 21:05

#How to Search for Text

## Tatoeba.org uses  [Sphinx Search](http://sphinxsearch.com/docs/current.html#boolean-syntax) 

* To find English sentences with "live", "lives", "living" or "lived", you can search using the word "live".

  * [live](http://tatoeba.org/eng/sentences/search?query=live+&from=eng&to=und)

* For exact matches, you need to use an equals sign (=) before a word. 

  * [=live](http://tatoeba.org/eng/sentences/search?query=%3Dlive+&from=eng&to=und)

* To search for a phrase, put quotes (") around it. Put an equals sign in front of each word that you want to be matched exactly.
  * If you want to see phrases like "live in Boston", "living in Boston", or "lives in Boston", use the following search:

      * ["live in boston"](http://tatoeba.org/eng/sentences/search?query=%22live+in+boston%22&from=eng&to=und)

  * The following search will only find sentences with the exact phrase "live in Boston".

      * ["=live =in =boston"](http://tatoeba.org/eng/sentences/search?query=%22%3Dlive+%3Din+%3Dboston%22&from=eng&to=und)

  * This search will only find sentences consisting only of the exact words "I live in Boston" with no other content.

      * ["^i =live =in boston$"](http://tatoeba.org/eng/sentences/search?query=%22%5Ei+live+in+boston%24%22&from=eng&to=und)

* Use a minus sign (-) to mean "no" (to find sentences without certain words). The following search will find sentences with "cheek" (in any form: cheeks, etc.) that don't also include any of the words preceded by a minus sign (-).

  * [cheek -tear -slap -burn -red -hollow](http://tatoeba.org/eng/sentences/search?query=cheek+-tear+-slap+-burn+-red+-hollow&from=eng&to=und)

* Leave punctuation out of your search string. Most punctuation will be ignored, but a final exclamation mark will actually interfere with the search. 
  * The following yields no results:

      * [how strange!](http://tatoeba.org/eng/sentences/search?query=how+strange!&from=eng&to=und)

  * but this search will find *How strange!* among other results:

      * [how strange](http://tatoeba.org/eng/sentences/search?query=how+strange&from=eng&to=und)

* Including the word "why" in a search will prevent any results from being returned. Similar short, high-frequency words such as "a" and "the" do not inhibit results this way. The cause of this behavior is not known. If you want to search for "why", precede it with an equals sign ("=why").

* Sentences that have been added since the last indexing operation will not turn up in the results. Sentences are indexed every month or two.

## More Details

Each page on Tatoeba features a box that allows you to search for text within the collection of sentences. The search ignores capitalization and punctuation (unless the punctuation happens to match one of the special characters described elsewhere on the page). An apostrophe within a word is not treated as punctuation, so you can find such words as "don't" by including them in an ordinary search string. 

The search will only find sentences that have been indexed by a script that is run periodically. Sentences that have been added more recently will not appear in the results. However, you can find the latest sentences added by a particular user (perhaps yourself), either by looking at the user's profile and selecting "Show latest activity" or by going to an address like [http://tatoeba.org/eng/sentences/of_user/trang](http://tatoeba.org/eng/sentences/of_user/trang) (where you replace "trang" with the name of the user whose sentences you want to see). Another option, which searches across sentences added by all users, is to use a Google search that includes the text "site:tatoeba.org" in addition to the words you are searching for.

The search engine used on Tatoeba is Sphinx. In many languages, including English, Sphinx **stems** the search words by default. This means that it removes certain trailing sequences from both search words and indexed words. Thus a search for *live* will also find *lived* and *living*.

If you want to find an exact match for a word, you must precede it with an equals sign, as in *=live*. This may come as a surprise to users who are accustomed to Google Search, where wrapping a word or phrase in double quotes forces an exact match. In Sphinx, double quotes have a different function, which only affects multiword (phrase) searches: wrapping a phrase in double quotes requires matching sentences to contain words in the specified continuous sequence. Simply placing a phrase in quotes does not suppress stemming of its individual words. To do that, you will need to place an equals sign before each word in the phrase for which you want to suppress stemming.

As an example, take the search *like thing*. This will find *like things*, *likely things*, and even *things like*. Adding quotes, as in *"like thing"*, will prevent a match against *things like* (where the words appear in the wrong order), but it will continue to match *like things*, *likely things*, and so on. By contrast, *"=like =thing"* will only match *like thing* (which does not occur in the Tatoeba corpus). Removing the double quotes, *=like =thing*, will match *What made you do a silly thing like that?* Removing one of the equals signs, as in *like =thing*, will find *Such a strange thing is not likely to happen.* 

You may be interested in other features, such as the following:

* A vertical bar (representing "or") finds examples where either of the words appears:
  *    *hate | detest* will match sentences with either *hate* or *detest* (or both). 

* If you want to combine an or-expression with other terms, you need to put the or-expression in parentheses: 
  *    *(red|blue) house* will match sentences in which the word "house" appears together with either "red" or "blue" (or both) 

* A dash (or exclamation point) before a word prevents matches with sentences where the word appears: *like -thing* (or *like !thing*) will match *I like ice cream* but not *I like that red thing*.

* Putting a caret (^) before a word will match only sentences that begin with that word: *^great* will match *Great people are not always wise.* but not *You are the great love of my life.* 

* Putting a dollar sign ($) after a word will match only sentences that end with that word: *life$* will match *This is the best day of my life.* but not *Life means nothing without friends.*

* If you want to search for sentences that contain nothing other than the specified words, use double quotes, a caret, and a dollar sign in combination: *"^i love you$"* will find *I love you.* and *I love you!* but not *I love you more than you love me.* (However, it will find *I loved you.* To prevent this match, use *"^i =love you$"*.)


See the [Sphinx documentation](http://sphinxsearch.com/docs/current.html#boolean-syntax) for other functionality. Note that the documentation mentions keywords pertaining to specific fields in a document, but these are not relevant to Tatoeba.

version at: 20/05/2014, 01:22

#How to Search for Text

## Tatoeba.org uses  [Sphinx Search](http://sphinxsearch.com/docs/current.html#boolean-syntax) 

* To find English sentences with "live", "lives", "living" or "lived", search for the word "live".

  * [live](http://tatoeba.org/eng/sentences/search?query=live+&from=eng&to=und)

* To match a word exactly, put an equals sign (=) before it. 

  * [=live](http://tatoeba.org/eng/sentences/search?query=%3Dlive+&from=eng&to=und)

* To search for a phrase, put quotes (") around it. Put an equals sign in front of each word that you want to be matched exactly.
  * If you want to see phrases like "live in Boston", "living in Boston", or "lives in Boston", use the following search:

      * ["live in boston"](http://tatoeba.org/eng/sentences/search?query=%22live+in+boston%22&from=eng&to=und)

  * The following search will only find sentences with the exact phrase "live in Boston".

      * ["=live =in =boston"](http://tatoeba.org/eng/sentences/search?query=%22%3Dlive+%3Din+%3Dboston%22&from=eng&to=und)

  * This search will only find sentences consisting of the exact words "I live in Boston" with no other content.

      * ["^i =live =in boston$"](http://tatoeba.org/eng/sentences/search?query=%22%5Ei+live+in+boston%24%22&from=eng&to=und)

* Use a minus sign (-) to mean "no" (to find sentences without certain words). The following search will find sentences with "cheek" (in any form: cheeks, etc.) that don't include any of the words preceded by a minus sign (-).

  * [cheek -tear -slap -burn -red -hollow](http://tatoeba.org/eng/sentences/search?query=cheek+-tear+-slap+-burn+-red+-hollow&from=eng&to=und)

* Leave punctuation out of your search string. Most punctuation will be ignored, but a final exclamation mark will actually interfere with the search. 
  * The following yields no results:

      * [how strange!](http://tatoeba.org/eng/sentences/search?query=how+strange!&from=eng&to=und)

  * but this search will find *How strange!* among other results:

      * [how strange](http://tatoeba.org/eng/sentences/search?query=how+strange&from=eng&to=und)

* Including the word "why" in a search will prevent any results from being returned. Similar short, high-frequency words such as "a" and "the" do not inhibit results this way. The cause of this behavior is not known. If you want to search for "why", precede it with an equals sign ("=why").

* Sentences that have been added since the last indexing operation will not turn up in the results. Sentences are indexed every month or two.

## More Details

Each page on Tatoeba features a box that allows you to search for text within the collection of sentences. The search ignores capitalization and punctuation (unless the punctuation happens to match one of the special characters described elsewhere on the page). An apostrophe within a word is not treated as punctuation, so you can find such words as "don't" by including them in an ordinary search string. 

The search will only find sentences that have been indexed by a script that is run periodically. Sentences that have been added more recently will not appear in the results. However, you can find the latest sentences added by a particular user (perhaps yourself), either by looking at the user's profile and selecting "Show latest activity" or by going to an address like [http://tatoeba.org/eng/sentences/of_user/trang](http://tatoeba.org/eng/sentences/of_user/trang) (where you replace "trang" with the name of the user whose sentences you want to see). Another option, which searches across sentences added by all users, is to use a Google search that includes the text "site:tatoeba.org" in addition to the words you are searching for.

The search engine used on Tatoeba is Sphinx. In many languages, including English, Sphinx **stems** the search words by default. This means that it removes certain trailing sequences from both search words and indexed words. Thus a search for *live* will also find *lived* and *living*.

If you want to find an exact match for a word, you must precede it with an equals sign, as in *=live*. This may come as a surprise to users who are accustomed to Google Search, where wrapping a word or phrase in double quotes forces an exact match. In Sphinx, double quotes have a different function, which only affects multiword (phrase) searches: wrapping a phrase in double quotes requires matching sentences to contain words in the specified continuous sequence. Simply placing a phrase in quotes does not suppress stemming of its individual words. To do that, you will need to place an equals sign before each word in the phrase for which you want to suppress stemming.

As an example, take the search *like thing*. This will find *like things*, *likely things*, and even *things like*. Adding quotes, as in *"like thing"*, will prevent a match against *things like* (where the words appear in the wrong order), but it will continue to match *like things*, *likely things*, and so on. By contrast, *"=like =thing"* will only match *like thing* (which does not occur in the Tatoeba corpus). Removing the double quotes, *=like =thing*, will match *What made you do a silly thing like that?* Removing one of the equals signs, as in *like =thing*, will find *Such a strange thing is not likely to happen.* 

You may be interested in other features, such as the following:

* A vertical bar (representing "or") finds examples where either of the words appears:
  *    *hate | detest* will match sentences with either *hate* or *detest* (or both). 

* If you want to combine an or-expression with other terms, you need to put the or-expression in parentheses: 
  *    *(red|blue) house* will match sentences in which the word "house" appears together with either "red" or "blue" (or both) 

* A dash (or exclamation point) before a word prevents matches with sentences where the word appears: *like -thing* (or *like !thing*) will match *I like ice cream* but not *I like that red thing*.

* Putting a caret (^) before a word will match only sentences that begin with that word: *^great* will match *Great people are not always wise.* but not *You are the great love of my life.* 

* Putting a dollar sign ($) after a word will match only sentences that end with that word: *life$* will match *This is the best day of my life.* but not *Life means nothing without friends.*

* If you want to search for sentences that contain nothing other than the specified words, use double quotes, a caret, and a dollar sign in combination: *"^i love you$"* will find *I love you.* and *I love you!* but not *I love you more than you love me.* (However, it will find *I loved you.* To prevent this match, use *"^i =love you$"*.)


See the [Sphinx documentation](http://sphinxsearch.com/docs/current.html#boolean-syntax) for other functionality. Note that the documentation mentions keywords pertaining to specific fields in a document, but these are not relevant to Tatoeba.

Note

The lines in green are the lines that have been added in the new version. The lines in red are those that have been removed.