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
47249ff3
Commit
47249ff3
authored
Dec 06, 2013
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Options parameter added to "\yii\mogo\Collection::fullTextSearch()"
parent
7314b5fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
Collection.php
extensions/mongo/Collection.php
+6
-8
No files found.
extensions/mongo/Collection.php
View file @
47249ff3
...
@@ -577,14 +577,15 @@ class Collection extends Object
...
@@ -577,14 +577,15 @@ class Collection extends Object
* @param string $search string of terms that MongoDB parses and uses to query the text index.
* @param string $search string of terms that MongoDB parses and uses to query the text index.
* @param array $condition criteria for filtering a results list.
* @param array $condition criteria for filtering a results list.
* @param array $fields list of fields to be returned in result.
* @param array $fields list of fields to be returned in result.
* @param integer $limit the maximum number of documents to include in the response (by default 100).
* @param array $options additional optional parameters to the mapReduce command. Valid options include:
* @param string $language he language that determines the list of stop words for the search
* - limit - the maximum number of documents to include in the response (by default 100).
* - language - the language that determines the list of stop words for the search
* and the rules for the stemmer and tokenizer. If not specified, the search uses the default
* and the rules for the stemmer and tokenizer. If not specified, the search uses the default
* language of the index.
* language of the index.
* @return array the highest scoring documents, in descending order by score.
* @return array the highest scoring documents, in descending order by score.
* @throws Exception on failure.
* @throws Exception on failure.
*/
*/
public
function
fullTextSearch
(
$search
,
$condition
=
[],
$fields
=
[],
$
limit
=
null
,
$language
=
null
)
{
public
function
fullTextSearch
(
$search
,
$condition
=
[],
$fields
=
[],
$
options
=
[]
)
{
$command
=
[
$command
=
[
'search'
=>
$search
'search'
=>
$search
];
];
...
@@ -594,11 +595,8 @@ class Collection extends Object
...
@@ -594,11 +595,8 @@ class Collection extends Object
if
(
!
empty
(
$fields
))
{
if
(
!
empty
(
$fields
))
{
$command
[
'project'
]
=
$fields
;
$command
[
'project'
]
=
$fields
;
}
}
if
(
$limit
!==
null
)
{
if
(
!
empty
(
$options
))
{
$command
[
'limit'
]
=
$limit
;
$command
=
array_merge
(
$command
,
$options
);
}
if
(
$language
!==
null
)
{
$command
[
'language'
]
=
$language
;
}
}
$token
=
$this
->
composeLogToken
(
'text'
,
$command
);
$token
=
$this
->
composeLogToken
(
'text'
,
$command
);
Yii
::
info
(
$token
,
__METHOD__
);
Yii
::
info
(
$token
,
__METHOD__
);
...
...
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