Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
be583a7a
Commit
be583a7a
authored
Nov 27, 2013
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed problem with sorting by id in elasticsearch
issue #1317
parent
58c02b49
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
12 deletions
+2
-12
QueryBuilder.php
extensions/elasticsearch/QueryBuilder.php
+1
-1
ActiveRecordTest.php
tests/unit/extensions/elasticsearch/ActiveRecordTest.php
+1
-1
ActiveRecordTestTrait.php
tests/unit/framework/ar/ActiveRecordTestTrait.php
+0
-10
No files found.
extensions/elasticsearch/QueryBuilder.php
View file @
be583a7a
...
@@ -116,7 +116,7 @@ class QueryBuilder extends \yii\base\Object
...
@@ -116,7 +116,7 @@ class QueryBuilder extends \yii\base\Object
$column
=
$name
;
$column
=
$name
;
}
}
if
(
$column
==
ActiveRecord
::
PRIMARY_KEY_NAME
)
{
if
(
$column
==
ActiveRecord
::
PRIMARY_KEY_NAME
)
{
$column
=
'_id'
;
$column
=
'_
u
id'
;
}
}
// allow elasticsearch extended syntax as described in http://www.elasticsearch.org/guide/reference/api/search/sort/
// allow elasticsearch extended syntax as described in http://www.elasticsearch.org/guide/reference/api/search/sort/
...
...
tests/unit/extensions/elasticsearch/ActiveRecordTest.php
View file @
be583a7a
...
@@ -231,11 +231,11 @@ class ActiveRecordTest extends ElasticSearchTestCase
...
@@ -231,11 +231,11 @@ class ActiveRecordTest extends ElasticSearchTestCase
public
function
testFindEagerViaRelation
()
public
function
testFindEagerViaRelation
()
{
{
// this test is currently failing randomly because of https://github.com/yiisoft/yii2/issues/1310
$orders
=
Order
::
find
()
->
with
(
'items'
)
->
orderBy
(
'create_time'
)
->
all
();
$orders
=
Order
::
find
()
->
with
(
'items'
)
->
orderBy
(
'create_time'
)
->
all
();
$this
->
assertEquals
(
3
,
count
(
$orders
));
$this
->
assertEquals
(
3
,
count
(
$orders
));
$order
=
$orders
[
0
];
$order
=
$orders
[
0
];
$this
->
assertEquals
(
1
,
$order
->
id
);
$this
->
assertEquals
(
1
,
$order
->
id
);
$this
->
assertTrue
(
$order
->
isRelationPopulated
(
'items'
));
$this
->
assertEquals
(
2
,
count
(
$order
->
items
));
$this
->
assertEquals
(
2
,
count
(
$order
->
items
));
$this
->
assertEquals
(
1
,
$order
->
items
[
0
]
->
id
);
$this
->
assertEquals
(
1
,
$order
->
items
[
0
]
->
id
);
$this
->
assertEquals
(
2
,
$order
->
items
[
1
]
->
id
);
$this
->
assertEquals
(
2
,
$order
->
items
[
1
]
->
id
);
...
...
tests/unit/framework/ar/ActiveRecordTestTrait.php
View file @
be583a7a
...
@@ -295,11 +295,6 @@ trait ActiveRecordTestTrait
...
@@ -295,11 +295,6 @@ trait ActiveRecordTestTrait
public
function
testFindLimit
()
public
function
testFindLimit
()
{
{
if
(
getenv
(
'TRAVIS'
)
==
'true'
&&
$this
instanceof
\yiiunit\extensions\elasticsearch\ActiveRecordTest
)
{
// https://github.com/yiisoft/yii2/issues/1317
$this
->
markTestSkipped
(
'This test is unreproduceable failing on travis-ci, locally it is passing.'
);
}
/** @var TestCase|ActiveRecordTestTrait $this */
/** @var TestCase|ActiveRecordTestTrait $this */
// all()
// all()
$customers
=
$this
->
callCustomerFind
()
->
all
();
$customers
=
$this
->
callCustomerFind
()
->
all
();
...
@@ -420,11 +415,6 @@ trait ActiveRecordTestTrait
...
@@ -420,11 +415,6 @@ trait ActiveRecordTestTrait
public
function
testFindLazyVia
()
public
function
testFindLazyVia
()
{
{
if
(
getenv
(
'TRAVIS'
)
==
'true'
&&
$this
instanceof
\yiiunit\extensions\elasticsearch\ActiveRecordTest
)
{
// https://github.com/yiisoft/yii2/issues/1317
$this
->
markTestSkipped
(
'This test is unreproduceable failing on travis-ci, locally it is passing.'
);
}
/** @var TestCase|ActiveRecordTestTrait $this */
/** @var TestCase|ActiveRecordTestTrait $this */
/** @var Order $order */
/** @var Order $order */
$order
=
$this
->
callOrderFind
(
1
);
$order
=
$this
->
callOrderFind
(
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment