Skip to content
Merged
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 build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "delphi-webapi"

version := "0.9.5-SNAPSHOT"
version := "0.9.6-SNAPSHOT"

scalaVersion := "2.13.1"

Expand Down
7 changes: 1 addition & 6 deletions src/main/resources/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"name" : "maven.artifactId",
"description": "ArtifactId of a Maven Package",
"internalName": "identifier.artifactid"
"internalName": "identifier.artifactId"
},
{
"name" : "maven.version",
Expand Down Expand Up @@ -674,11 +674,6 @@
"internalName": "hermes.features.public fields\nonly used by defininig type ",
"name": "metrics.fields.publicvisiblelocal"
},
{
"description": "",
"internalName": "hermes.features.sun",
"name": "sun"
},
{
"description": "Object-based Thread Notification (Object.notify, notifyAll, or wait).",
"internalName": "hermes.features.Object-based Thread Notification",
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/de/upb/cs/swt/delphi/webapi/FeatureQuery.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ import org.slf4j.LoggerFactory
import spray.json._
import de.upb.cs.swt.delphi.webapi.FeatureJson._

import scala.io.Source
import scala.io.{Codec, Source}

class FeatureQuery(configuration: Configuration) {
private val log = LoggerFactory.getLogger(this.getClass)

lazy val featureList: Iterable[Feature] =
Source.fromResource("features.json")
Source.fromResource("features.json")(Codec.UTF8)
.getLines()
.mkString("\n")
.parseJson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import de.upb.cs.swt.delphi.webapi.InternalFeature
import org.joda.time.format.ISODateTimeFormat
import spray.json.JsArray

import scala.io.Source
import scala.io.{Codec, Source}
import spray.json._
import de.upb.cs.swt.delphi.webapi.FeatureJson._
import de.upb.cs.swt.delphi.webapi.search.SearchResults

object ArtifactTransformer {
private lazy val internalFeatures = Source.fromResource("features.json")
private lazy val internalFeatures = Source.fromResource("features.json")(Codec.UTF8)
.getLines()
.mkString("\n")
.parseJson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ package de.upb.cs.swt.delphi.webapi.search
import com.sksamuel.elastic4s.http.ElasticDsl._
import com.sksamuel.elastic4s.http.search.SearchHits
import com.sksamuel.elastic4s.http.{ElasticClient, RequestFailure, RequestSuccess}
import com.sksamuel.elastic4s.searches.queries.matches.MatchQuery
import com.sksamuel.elastic4s.searches.queries.{NoopQuery, Query}
import de.upb.cs.swt.delphi.core.model._
import de.upb.cs.swt.delphi.core.ql._
import de.upb.cs.swt.delphi.webapi.artifacts.ArtifactTransformer
import de.upb.cs.swt.delphi.webapi.{Configuration, Feature, FeatureQuery, InternalFeature}
import spray.json.JsArray

import scala.io.Source
import scala.io.{Codec, Source}
import scala.util.{Failure, Success, Try}
import spray.json._
import de.upb.cs.swt.delphi.webapi.FeatureJson._
Expand All @@ -35,7 +36,7 @@ import de.upb.cs.swt.delphi.webapi.FeatureJson._
class SearchQuery(configuration: Configuration, featureExtractor: FeatureQuery) {
private val client = ElasticClient(configuration.elasticsearchClientUri)

lazy val internalFeatures = Source.fromResource("features.json")
lazy val internalFeatures = Source.fromResource("features.json")(Codec.UTF8)
.getLines()
.mkString("\n")
.parseJson
Expand Down Expand Up @@ -112,7 +113,7 @@ class SearchQuery(configuration: Configuration, featureExtractor: FeatureQuery)
)
)
}
case EqualExpr(field, value) => matchQuery(externalToInternalFeature(field.fieldName), value)
case EqualExpr(field, value) => matchQuery(externalToInternalFeature(field.fieldName), value)
case NotEqualExpr(field, value) => bool(not(matchQuery(externalToInternalFeature(field.fieldName), value)))
case GreaterThanExpr(field, value) => rangeQuery(externalToInternalFeature(field.fieldName)).gt(value.toLong)
case GreaterOrEqualExpr(field, value) => rangeQuery(externalToInternalFeature(field.fieldName)).gte(value.toLong)
Expand Down