32 lines
600 B
Ruby
32 lines
600 B
Ruby
|
require 'elasticsearch/model'
|
||
|
|
||
|
class Paste < ApplicationRecord
|
||
|
include Elasticsearch::Model
|
||
|
include Elasticsearch::Model::Callbacks
|
||
|
|
||
|
|
||
|
# this doesnt work yet, but this is how we build a way to progrmatically query ES
|
||
|
# def self.search(query)
|
||
|
# __elasticsearch__.search(
|
||
|
# {
|
||
|
# query: {
|
||
|
# multi_match: {
|
||
|
# query: query,
|
||
|
# }
|
||
|
# },
|
||
|
# "highlight": {
|
||
|
# "pre_tags": [
|
||
|
# "@kibana-highlighted-field@"
|
||
|
# ],
|
||
|
# "post_tags": [
|
||
|
# "@/kibana-highlighted-field@"
|
||
|
# ],
|
||
|
# "fields": {
|
||
|
# "*": {}
|
||
|
# }
|
||
|
# }
|
||
|
# }
|
||
|
# )
|
||
|
# end
|
||
|
end
|