       end
     end
 
+    search = queries[:search]
+
+    if word do
+      search = Keyword.delete(search, :query)
+      search = search ++ query do
+        multi_match word, fields, cutoff_frequency: 0.001, boost: 10, use_dis_max: false, operator: "and"
+      end
+
+      queries = Keyword.put queries, :search, search
+    end
+
     Logger.debug "#{inspect queries}"
+    Logger.debug "#{JSX.prettify! JSX.encode!(queries)}"
     Tirexs.Query.create_resource(queries)
   end
 

  # need to agent.
 
  import Tirexs.Bulk
  import Tirexs.Search
  import Tirexs.Mapping
  import Tirexs.Index.Settings

  require Tirexs.Query
  require Tirexs.ElasticSearch

  require Logger

      url: model.url,
      time: model.time,
      title: model.title,
      content: model.content,

      # tags: model.tag_list,
      # divas: Enum.map(model.divas, &(&1.name)),
