Skip to content
This repository has been archived by the owner on Jun 30, 2018. It is now read-only.

Fixed deadlinks from dsl file #892

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ To test-drive the core _Elasticsearch_ functionality, let's require the gem:
```

Please note that you can copy these snippets from the much more extensive and heavily annotated file
in [examples/tire-dsl.rb](http://karmi.github.com/retire/).
in [examples/tire-dsl.rb](https://github.com/karmi/retire/blob/master/examples/tire-dsl.rb).

Also, note that we're doing some heavy JSON lifting here. _Tire_ uses the
[_multi_json_](https://github.com/intridea/multi_json) gem as a generic JSON wrapper,
Expand Down
48 changes: 25 additions & 23 deletions examples/tire-dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def to_indexed_json
refresh
end

# We may want to define a specific [mapping](http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html)
# We may want to define a specific [mapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html)
# for the index.

Tire.index 'articles' do
Expand Down Expand Up @@ -154,7 +154,7 @@ def to_indexed_json
#### Bulk Indexing

# Of course, we may have large amounts of data, and adding them to the index one by one really isn't the best idea.
# We can use _Elasticsearch's_ [bulk API](http://www.elasticsearch.org/guide/reference/api/bulk.html)
# We can use _Elasticsearch's_ [bulk API](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html)
# for importing the data.

# So, for demonstration purposes, let's suppose we have a simple collection of hashes to store.
Expand Down Expand Up @@ -410,7 +410,7 @@ def self.search

# Quite often, we need complex queries with boolean logic.
# Instead of composing long query strings such as `tags:ruby OR tags:java AND NOT tags:python`,
# we can use the [_bool_](http://www.elasticsearch.org/guide/reference/query-dsl/bool-query.html)
# we can use the [_bool_](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html)
# query.

s = Tire.search('articles') do
Expand Down Expand Up @@ -475,15 +475,15 @@ def self.search
#
# Eventually, _Tire_ will support all of them. So far, only these are supported:
#
# * [string](http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html)
# * [text](http://www.elasticsearch.org/guide/reference/query-dsl/text-query.html)
# * [term](http://elasticsearch.org/guide/reference/query-dsl/term-query.html)
# * [terms](http://elasticsearch.org/guide/reference/query-dsl/terms-query.html)
# * [bool](http://www.elasticsearch.org/guide/reference/query-dsl/bool-query.html)
# * [custom_score](http://www.elasticsearch.org/guide/reference/query-dsl/custom-score-query.html)
# * [fuzzy](http://www.elasticsearch.org/guide/reference/query-dsl/fuzzy-query.html)
# * [all](http://www.elasticsearch.org/guide/reference/query-dsl/match-all-query.html)
# * [ids](http://www.elasticsearch.org/guide/reference/query-dsl/ids-query.html)
# * [string](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html)
# * [text](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-text-query.html)
# * [term](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-term-query.html)
# * [terms](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html)
# * [bool](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html)
# * [custom_score](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-custom-score-query.html)
# * [fuzzy](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html)
# * [all](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-all-query.html)
# * [ids](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-ids-query.html)

#### Faceted Search

Expand Down Expand Up @@ -583,13 +583,15 @@ def self.search
#
# Eventually, _Tire_ will support all of them. So far, only these are supported:
#
# * [terms](http://www.elasticsearch.org/guide/reference/api/search/facets/terms-facet.html)
# * [date](http://www.elasticsearch.org/guide/reference/api/search/facets/date-histogram-facet.html)
# * [range](http://www.elasticsearch.org/guide/reference/api/search/facets/range-facet.html)
# * [histogram](http://www.elasticsearch.org/guide/reference/api/search/facets/histogram-facet.html)
# * [statistical](http://www.elasticsearch.org/guide/reference/api/search/facets/statistical-facet.html)
# * [terms_stats](http://www.elasticsearch.org/guide/reference/api/search/facets/terms-stats-facet.html)
# * [query](http://www.elasticsearch.org/guide/reference/api/search/facets/query-facet.html)
# * [terms](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-terms-facet.html)
# * [range](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-range-facet.html)
# * [histogram](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-histogram-facet.html)
# * [date_histogram](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-date-histogram-facet.html)
# * [filter](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-filter-facet.html)
# * [query](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-query-facet.html)
# * [statistical](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-statistical-facet.html)
# * [terms_stats](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-terms-stats-facet.html)
# * [geo_distance](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-geo-distance-facet.html)

# We have seen that _Elasticsearch_ facets enable us to fetch complex aggregations from our data.
#
Expand Down Expand Up @@ -732,8 +734,8 @@ def self.search
# We need to query parts of the document as if they were separate entities.

# _Elasticsearch_ provides a specific `nested`
# [field type](http://www.elasticsearch.org/guide/reference/mapping/nested-type.html) and
# [query](http://www.elasticsearch.org/guide/reference/query-dsl/nested-query.html)
# [field type](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-nested-type.html) and
# [query](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-nested-query.html)
# for working with "embedded" documents like these.

# So, let's update the mapping for the index first, adding the `comments` property as a `nested` type:
Expand Down Expand Up @@ -778,7 +780,7 @@ def self.search

# Often, we want to highlight the snippets matching our query in the displayed results.
# _Elasticsearch_ provides rich
# [highlighting](http://www.elasticsearch.org/guide/reference/api/search/highlighting.html)
# [highlighting](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html)
# features, and _Tire_ makes them trivial to use.
#
s = Tire.search 'articles' do
Expand Down Expand Up @@ -819,7 +821,7 @@ def self.search
#### Percolation

# _Elasticsearch_ comes with one very interesting, and rather unique feature:
# [_percolation_](http://www.elasticsearch.org/guide/reference/api/percolate.html).
# [_percolation_](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html).

# It works in a „reverse search“ manner to regular search workflow of adding
# documents to the index and then querying them.
Expand Down