File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 runs-on : ubuntu-latest
1313 services :
1414 rumors-test-db :
15- image : docker.elastic.co/elasticsearch/elasticsearch-oss:6.3 .2
15+ image : docker.elastic.co/elasticsearch/elasticsearch:9.2 .2
1616 ports :
1717 - 62223:9200
18+ env :
19+ discovery.type : single-node
1820 steps :
1921
2022 - name : Checkout rumors-db
2325 repository : ' cofacts/rumors-db'
2426 - uses : actions/setup-node@v4
2527 with :
26- node-version : ' 18 '
28+ node-version : ' 24 '
2729 cache : ' npm'
2830 - run : npm ci
2931 - name : Initialize DB indexes
Original file line number Diff line number Diff line change 1212 snapshot : ${{ steps.find-snapshot.outputs.snapshot }}
1313 services :
1414 elasticsearch :
15- image : docker.elastic.co/elasticsearch/elasticsearch-oss:6.3 .2
15+ image : docker.elastic.co/elasticsearch/elasticsearch:9.2 .2
1616 ports :
1717 - 62223:9200
1818 env :
2929 - name : Setup Node.js
3030 uses : actions/setup-node@v4
3131 with :
32- node-version : ' 18 '
32+ node-version : ' 24 '
3333 cache : ' npm'
3434
3535 - name : Prepare directory and secrets
4343 - name : Install GCS Plugin & Keystore
4444 run : |
4545 # Find the container ID
46- CONTAINER_ID=$(docker ps --filter "ancestor=docker.elastic.co/elasticsearch/elasticsearch-oss:6.3 .2" --format "{{.ID}}")
46+ CONTAINER_ID=$(docker ps --filter "ancestor=docker.elastic.co/elasticsearch/elasticsearch:9.2 .2" --format "{{.ID}}")
4747 echo "Elasticsearch container ID: $CONTAINER_ID"
4848
4949 if [ -z "$CONTAINER_ID" ]; then
Original file line number Diff line number Diff line change @@ -11,15 +11,16 @@ version: '2'
1111
1212services :
1313 elasticsearch :
14- image : docker.elastic.co/elasticsearch/elasticsearch-oss:6.3 .2
14+ image : docker.elastic.co/elasticsearch/elasticsearch:9.2 .2
1515 volumes :
1616 - " ./esdata:/usr/share/elasticsearch/data"
1717 environment :
1818 - " path.repo=/usr/share/elasticsearch/data"
19+ - " discovery.type=single-node"
1920 ports :
2021 - " 62223:9200"
2122
2223 kibana :
23- image : docker.elastic.co/kibana/kibana-oss:6.3 .2
24+ image : docker.elastic.co/kibana/kibana:9.2 .2
2425 ports :
2526 - " 62224:5601"
Original file line number Diff line number Diff line change @@ -29,24 +29,27 @@ function sha256(input) {
2929async function * scanIndex ( index ) {
3030 let processedCount = 0 ;
3131
32- const { body : initialResult } = await client . search ( {
32+ let initialResult = await client . search ( {
3333 index,
3434 size : 200 ,
3535 scroll : '5m' ,
36+ track_total_hits : true ,
3637 } ) ;
3738
38- const totalCount = initialResult . hits . total ;
39+ const totalCount = initialResult . hits . total . value ;
40+ let scrollId = initialResult . _scroll_id ;
3941
4042 for ( const hit of initialResult . hits . hits ) {
4143 processedCount += 1 ;
4244 yield hit ;
4345 }
4446
4547 while ( processedCount < totalCount ) {
46- const { body : scrollResult } = await client . scroll ( {
47- scrollId : initialResult . _scroll_id ,
48+ const scrollResult = await client . scroll ( {
49+ scrollId,
4850 scroll : '5m' ,
4951 } ) ;
52+ scrollId = scrollResult . _scroll_id ;
5053 for ( const hit of scrollResult . hits . hits ) {
5154 processedCount += 1 ;
5255 yield hit ;
Original file line number Diff line number Diff line change @@ -39,23 +39,26 @@ function sha256(input) {
3939async function scanIndex ( index ) {
4040 let result = [ ] ;
4141
42- const { body : initialResult } = await client . search ( {
42+ const initialResult = await client . search ( {
4343 index,
4444 size : 200 ,
4545 scroll : '5m' ,
46+ track_total_hits : true ,
4647 } ) ;
4748
48- const totalCount = initialResult . hits . total ;
49+ const totalCount = initialResult . hits . total . value ;
50+ let scrollId = initialResult . _scroll_id ;
4951
5052 initialResult . hits . hits . forEach ( ( hit ) => {
5153 result . push ( hit ) ;
5254 } ) ;
5355
5456 while ( result . length < totalCount ) {
55- const { body : scrollResult } = await client . scroll ( {
56- scrollId : initialResult . _scroll_id ,
57+ const scrollResult = await client . scroll ( {
58+ scrollId,
5759 scroll : '5m' ,
5860 } ) ;
61+ scrollId = scrollResult . _scroll_id ;
5962 scrollResult . hits . hits . forEach ( ( hit ) => {
6063 result . push ( hit ) ;
6164 } ) ;
You can’t perform that action at this time.
0 commit comments