Skip to content

Commit

Permalink
FIX: Add /v2 to import pathes in packages & Fix test for regexp & fuzzy
Browse files Browse the repository at this point in the history
  • Loading branch information
sdqri committed Aug 21, 2024
1 parent 5690699 commit 082fd39
Show file tree
Hide file tree
Showing 45 changed files with 58 additions and 58 deletions.
12 changes: 6 additions & 6 deletions effdsl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (

"github.com/stretchr/testify/assert"

effdsl "github.com/sdqri/effdsl"
bq "github.com/sdqri/effdsl/queries/boolquery"
eq "github.com/sdqri/effdsl/queries/existsquery"
qs "github.com/sdqri/effdsl/queries/querystring"
rq "github.com/sdqri/effdsl/queries/rangequery"
tq "github.com/sdqri/effdsl/queries/termquery"
"github.com/sdqri/effdsl/v2"
bq "github.com/sdqri/effdsl/v2/queries/boolquery"
eq "github.com/sdqri/effdsl/v2/queries/existsquery"
qs "github.com/sdqri/effdsl/v2/queries/querystring"
rq "github.com/sdqri/effdsl/v2/queries/rangequery"
tq "github.com/sdqri/effdsl/v2/queries/termquery"
)

func TestWithQuery(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/boolquery/bool_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"errors"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type CompoundQueries string
Expand Down
4 changes: 2 additions & 2 deletions queries/boolquery/bool_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/stretchr/testify/assert"

effdsl "github.com/sdqri/effdsl"
bq "github.com/sdqri/effdsl/queries/boolquery"
effdsl "github.com/sdqri/effdsl/v2"
bq "github.com/sdqri/effdsl/v2/queries/boolquery"
)

func TestBoolQuery(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/boostingquery/boosting_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type BoostingQueryS struct {
Expand Down
4 changes: 2 additions & 2 deletions queries/boostingquery/boosting_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/stretchr/testify/assert"

bq "github.com/sdqri/effdsl/queries/boostingquery"
tq "github.com/sdqri/effdsl/queries/termquery"
bq "github.com/sdqri/effdsl/v2/queries/boostingquery"
tq "github.com/sdqri/effdsl/v2/queries/termquery"
)

func TestBoostingQuery(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/constantscore/constant_score.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type ConstantScoreQueryS struct {
Expand Down
4 changes: 2 additions & 2 deletions queries/constantscore/constant_score_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/stretchr/testify/assert"

cs "github.com/sdqri/effdsl/queries/constantscore"
tq "github.com/sdqri/effdsl/queries/termquery"
cs "github.com/sdqri/effdsl/v2/queries/constantscore"
tq "github.com/sdqri/effdsl/v2/queries/termquery"
)

func TestConstantScoreQuery_WithAllOptions(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/dismaxquery/dis_max_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type DisMaxQueryS struct {
Expand Down
6 changes: 3 additions & 3 deletions queries/dismaxquery/dis_max_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/stretchr/testify/assert"

"github.com/sdqri/effdsl"
dmq "github.com/sdqri/effdsl/queries/dismaxquery"
tq "github.com/sdqri/effdsl/queries/termquery"
"github.com/sdqri/effdsl/v2"
dmq "github.com/sdqri/effdsl/v2/queries/dismaxquery"
tq "github.com/sdqri/effdsl/v2/queries/termquery"
)

func TestDisMaxQuery(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/existsquery/exists_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package existsquery
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type ExistsQueryS struct {
Expand Down
2 changes: 1 addition & 1 deletion queries/existsquery/exists_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

eq "github.com/sdqri/effdsl/queries/existsquery"
eq "github.com/sdqri/effdsl/v2/queries/existsquery"
)

func TestNewExistsQuery(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/fuzzyquery/fuzzy_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package fuzzyquery
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

// FuzzyQueryS represents a query that matches documents containing terms
Expand Down
2 changes: 1 addition & 1 deletion queries/fuzzyquery/fuzzy_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

fq "github.com/sdqri/effdsl/queries/fuzzyquery"
fq "github.com/sdqri/effdsl/v2/queries/fuzzyquery"
)

func TestFuzzyQuery_WithNoOptions(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/idsquery/ids_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package idsquery
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

// IDsQueryS represents the structure of the IDs query.
Expand Down
2 changes: 1 addition & 1 deletion queries/idsquery/ids_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

iq "github.com/sdqri/effdsl/queries/idsquery"
iq "github.com/sdqri/effdsl/v2/queries/idsquery"
)

func TestIDsQuery(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/matchboolprefix/match_boolean_prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package matchboolprefix
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type MatchBoolPrefixQueryS struct {
Expand Down
2 changes: 1 addition & 1 deletion queries/matchboolprefix/match_boolean_prefix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

mbpq "github.com/sdqri/effdsl/queries/matchboolprefix"
mbpq "github.com/sdqri/effdsl/v2/queries/matchboolprefix"
)

func TestNewMatchBoolPrefixQueryWithAnalyzer(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/matchphraseprefix/match_phrase_prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package matchphraseprefix
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type MatchPhrasePrefixQueryS struct {
Expand Down
2 changes: 1 addition & 1 deletion queries/matchphraseprefix/match_phrase_prefix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

mppq "github.com/sdqri/effdsl/queries/matchphraseprefix"
mppq "github.com/sdqri/effdsl/v2/queries/matchphraseprefix"
)

func TestNewMatchPhrasePrefixQueryWithNoOptions(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/matchphrasequery/match_phrase_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package matchphrasequery
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type MatchPhraseQueryS struct {
Expand Down
2 changes: 1 addition & 1 deletion queries/matchphrasequery/match_phrase_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

mpq "github.com/sdqri/effdsl/queries/matchphrasequery"
mpq "github.com/sdqri/effdsl/v2/queries/matchphrasequery"
)

func TestNewMatchPhraseQueryWithNoOptions(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/matchquery/match_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package matchquery
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type MatchQueryS struct {
Expand Down
2 changes: 1 addition & 1 deletion queries/matchquery/match_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/stretchr/testify/require"

mq "github.com/sdqri/effdsl/queries/matchquery"
mq "github.com/sdqri/effdsl/v2/queries/matchquery"
)

func Test_MatchQueryS_MarshalJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/prefixquery/prefix_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package prefixquery
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

// PrefixQueryS represents a query that matches documents containing terms
Expand Down
2 changes: 1 addition & 1 deletion queries/prefixquery/prefix_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

pq "github.com/sdqri/effdsl/queries/prefixquery"
pq "github.com/sdqri/effdsl/v2/queries/prefixquery"
)

func TestPrefixQuery_WithNoOptions(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/querystring/query_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package querystring
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type QueryStringS struct {
Expand Down
2 changes: 1 addition & 1 deletion queries/querystring/query_string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

qs "github.com/sdqri/effdsl/queries/querystring"
qs "github.com/sdqri/effdsl/v2/queries/querystring"
)

func TestQueryString(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/rangequery/range_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"errors"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type RangeQueryS struct {
Expand Down
2 changes: 1 addition & 1 deletion queries/rangequery/range_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

rq "github.com/sdqri/effdsl/queries/rangequery"
rq "github.com/sdqri/effdsl/v2/queries/rangequery"
)

func TestNewRangeQueryWithNoOptions(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/regexpquery/regexp_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package regexpquery
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

// RegexpQueryS represents a query that matches documents containing terms
Expand Down
4 changes: 2 additions & 2 deletions queries/regexpquery/regexp_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

rq "github.com/sdqri/effdsl/queries/regexpquery"
rq "github.com/sdqri/effdsl/v2/queries/regexpquery"
)

func TestRegexpQuery_WithNoOptions(t *testing.T) {
Expand All @@ -20,7 +20,7 @@ func TestRegexpQuery_WithNoOptions(t *testing.T) {
}

func TestRegexpQuery_WithAllOptions(t *testing.T) {
expectedBody := `{"regexp":{"fake_field":{"value":"fake_value","flags":"fake_flags","case_insensitive":true,"max_determinized_states":100,"rewrite":"fake_rewrite"}}}`
expectedBody := `{"regexp":{"fake_field":{"value":"fake_value","flags":"fake_flags","case_insensitive":true,"max_determinized_states":100,"rewrite":"constant_score"}}}`
regexpQueryResult := rq.RegexpQuery(
"fake_field",
"fake_value",
Expand Down
2 changes: 1 addition & 1 deletion queries/simplequerystring/simple_query_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package simplequerystring
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type Simple struct {
Expand Down
2 changes: 1 addition & 1 deletion queries/simplequerystring/simple_query_string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

sqs "github.com/sdqri/effdsl/queries/simplequerystring"
sqs "github.com/sdqri/effdsl/v2/queries/simplequerystring"
)

func TestQueryString(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/termquery/term_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package termquery
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type TermQueryS struct {
Expand Down
2 changes: 1 addition & 1 deletion queries/termquery/term_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

tq "github.com/sdqri/effdsl/queries/termquery"
tq "github.com/sdqri/effdsl/v2/queries/termquery"
)

func TestNewTermQuery(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions queries/termsquery/terms_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package termsquery
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/utils"
"github.com/sdqri/effdsl/v2"
"github.com/sdqri/effdsl/v2/utils"
)

type TermsQueryS struct {
Expand Down
2 changes: 1 addition & 1 deletion queries/termsquery/terms_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

tsq "github.com/sdqri/effdsl/queries/termsquery"
tsq "github.com/sdqri/effdsl/v2/queries/termsquery"
)

func TestNewTermsQuery(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/termssetquery/terms_set_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package termssetquery
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

type TermSetQueryS struct {
Expand Down
2 changes: 1 addition & 1 deletion queries/termssetquery/terms_set_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

tsq "github.com/sdqri/effdsl/queries/termssetquery"
tsq "github.com/sdqri/effdsl/v2/queries/termssetquery"
)

func TestNewTermSetQuery_WithTermsOnly(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion queries/wildcardquery/wildcard_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package wildcardquery
import (
"encoding/json"

"github.com/sdqri/effdsl"
"github.com/sdqri/effdsl/v2"
)

// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html
Expand Down
Loading

0 comments on commit 082fd39

Please sign in to comment.