score:0
i think your query can be simplified a bit, to something like:
{
"query": {
"term": {
"url": {
"value": "http://example.com"
}
}
}
}
weirdly, i would expect your query to return all documents, due to the nesting of your boolean queries. should
means documents that match any query in the array are scored higher than those not matching. so, a should
containing only one must
should return all documents, with matching documents scored higher than non matching.
score:1
problem solved.
in the mapping, instead of doing:
client.execute {
create index <my_index> mappings {
<my_type> as {
"url" typed stringtype analyzer notanalyzed
}
}
}
i should have done:
client.execute {
create index <my_index> mappings {
<my_type> as {
"url" typed stringtype index "not_analyzed"
}
}
}
or
client.execute {
create index <my_index> mappings {
<my_type> as {
"url" typed stringtype index notanalyzed
}
}
}
Source: stackoverflow.com
Related Query
- Searching for whole URL using elastic4s
- Is there a hotkey for searching for references in IntelliJ when using Scala?
- Searching for Annotations in Methods using Scala
- Using elastic4s local client for testing
- Using Elastic4s for Percolator Queries
- Building dynamic aggregation queries for elasticsearch using elastic4s client
- Using elastic4s for GeoDistance queries
- How can I get complete stacktraces for exceptions thrown in tests when using sbt and testng?
- How do I check for equality using Spark Dataframe without SQL Query?
- Using Scalaz Stream for parsing task (replacing Scalaz Iteratees)
- Using Reader Monad for Dependency Injection
- Searching the Scala documentation for #::
- Is anyone using Scala in anger (and what advice for a Java programmer)?
- Why is the error "Unable to find encoder for type stored in a Dataset" when encoding JSON using case classes?
- noClassDefFoundError using Scala Plugin for Eclipse
- Alternatives to using "var" for state with actors?
- How to specify schema for CSV file without using Scala case class?
- Using find function for maps in scala
- What are the weaknesses in using Immutability + Actor model for concurrency programming?
- Play Framework 2.1: Scala: how to get the whole base url (including protocol)?
- download a zip from url and extract it in resource using SBT
- Using Apache Spark as a backend for web application
- Using Finagle for simple Scala SOAP client
- How to test for additional properties of expected Exceptions using ScalaTest
- Why does Slick require using three equal signs (===) for comparison?
- How can I get a Random URL on http request for Gatling?
- Using Scala continuations for non-blocking APIs
- Using Scala's Delimited Continuations for implicit Monads
- Using Streams for iteration in Scala
- reading data from URL using spark databricks platform
More Query from same tag
- spark scala map column names to output arraytype column for values true
- Global Variable in Scala
- Update Value of Entire Column in HBase
- Gatling test that uses a different action every request
- How to retrive keys by comparing values of map list from config in scala
- Compilation Error in Play 2 Scala Templates
- How to emulate a BehaviorSubject with a connectable Observable in RX-Scala
- Delete values lower than cummax on multiple spark dataframe columns in scala
- Why is the simpleName for "Float" actually "float"?
- Gatling: Access variables from saved "findAll" list in foreach loop
- Scala - Groupby and Max on pair RDD
- What is the preferred way in mill to point to the directory where build.sc file is located?
- Compile time structural typing of close method
- "build.js does not exist" after upgrading to Play 2.3 (requireJsShim)
- Spark Dataframe sliding window over pair of rows
- scala: type equality of two variables
- akka jvm threads vs os threads when performing io
- Scala. Data frame how to name change the one column
- How can I explicitly tell the compiler what the return type is?
- Expand type class operations on elements using macros
- Warning about an unchecked type argument in this Scala pattern match?
- Compress and Serialize a large HashMap in memory
- Akka Stream connect to multiple sinks
- Spark Scala: Pass a sub type to a function accepting the parent type
- scala 2.13 - error during compiling plugin
- How do I serialize CharSequence to JSON with Play 2.1 and Scala
- Returning NonEmptyList `sealed trait`'s w/ scalaz.Validation
- Jquery Not working in onchange function (Play scala view page and Ajax)
- Scalaz Kleisli usage benefits
- Implicit map, or something like that