-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enh #144: Add
UINT_SET
attribute type support + Fix tests and CI
- Loading branch information
Showing
10 changed files
with
210 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh -e | ||
SCRIPT=$(readlink -f "$0") | ||
CWD=$(dirname "$SCRIPT") | ||
|
||
wget https://sphinxsearch.com/files/sphinx-3.5.1-82c60cb-linux-amd64.tar.gz -O /tmp/sphinxsearch.tar.gz | ||
sudo mkdir /opt/sphinx | ||
cd /opt/sphinx && sudo tar -zxf /tmp/sphinxsearch.tar.gz | ||
rm /tmp/sphinxsearch.tar.gz | ||
|
||
# make dir that is used in sphinx config | ||
mkdir -p $PWD/sphinx | ||
sed -i s\~SPHINX_BASE_DIR~$PWD/sphinx~g $CWD/../sphinx-3.5.1.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1056,4 +1056,4 @@ INSERT INTO `yii2_test_article_tag` (`article_id`, `tag_id`) VALUES | |
(1, 2), | ||
(1, 3), | ||
(2, 3), | ||
(2, 4); | ||
(2, 4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# Sphinx configuration for the unit tests | ||
# | ||
# Setup test environment: | ||
# - initialize test database source: | ||
# mysql -D yiitest -u test < /path/to/yii/tests/unit/data/sphinx/source.sql | ||
# - setup test Sphinx indexes: | ||
# indexer --config /path/to/yii/tests/unit/data/sphinx/sphinx.conf --all [--rotate] | ||
# - run the "searchd" daemon: | ||
# searchd --config /path/to/yii/tests/unit/data/sphinx/sphinx.conf | ||
|
||
|
||
source yii2_test_article_src | ||
{ | ||
type = mysql | ||
|
||
sql_host = 127.0.0.1 | ||
sql_user = root | ||
sql_pass = root | ||
sql_db = yiitest | ||
sql_port = 3306 # optional, default is 3306 | ||
|
||
sql_query = \ | ||
SELECT *, UNIX_TIMESTAMP(create_date) AS add_date \ | ||
FROM yii2_test_article | ||
|
||
sql_attr_uint = author_id | ||
sql_attr_uint = add_date | ||
sql_attr_multi = uint tag from query; SELECT article_id AS id, tag_id AS tag FROM yii2_test_article_tag | ||
} | ||
|
||
|
||
source yii2_test_item_src | ||
{ | ||
type = mysql | ||
|
||
sql_host = 127.0.0.1 | ||
sql_user = root | ||
sql_pass = root | ||
sql_db = yiitest | ||
sql_port = 3306 # optional, default is 3306 | ||
|
||
sql_query = \ | ||
SELECT *, CURRENT_TIMESTAMP() AS add_date \ | ||
FROM yii2_test_item \ | ||
WHERE id <= 100 | ||
|
||
sql_attr_uint = category_id | ||
sql_attr_float = price | ||
sql_attr_uint = add_date | ||
} | ||
|
||
|
||
source yii2_test_item_delta_src : yii2_test_item_src | ||
{ | ||
sql_query = \ | ||
SELECT *, CURRENT_TIMESTAMP() AS add_date \ | ||
FROM yii2_test_item \ | ||
WHERE id > 100 | ||
} | ||
|
||
|
||
index yii2_test_article_index | ||
{ | ||
source = yii2_test_article_src | ||
} | ||
|
||
|
||
index yii2_test_item_index | ||
{ | ||
source = yii2_test_item_src | ||
} | ||
|
||
|
||
index yii2_test_item_delta_index : yii2_test_item_index | ||
{ | ||
source = yii2_test_item_delta_src | ||
} | ||
|
||
|
||
index yii2_test_rt_index | ||
{ | ||
type = rt | ||
rt_field = title | ||
rt_attr_string = title | ||
rt_field = content | ||
rt_attr_uint = type_id | ||
rt_attr_multi = category | ||
} | ||
|
||
|
||
index yii2_test_distributed | ||
{ | ||
type = distributed | ||
local = yii2_test_article_index | ||
} | ||
|
||
common { | ||
datadir = SPHINX_BASE_DIR | ||
} | ||
|
||
indexer | ||
{ | ||
mem_limit = 32M | ||
} | ||
|
||
searchd | ||
{ | ||
#listen = 127.0.0.1:9312 | ||
listen = 19306:mysql41 | ||
read_timeout = 5 | ||
max_children = 30 | ||
seamless_rotate = 1 | ||
preopen_indexes = 1 | ||
unlink_old = 1 | ||
workers = threads # for RT to work | ||
} |