Merge pull request #4418 from blockscout/vb-empty-search-results

Fix empty search results for the full-word search criteria
pull/4423/head
Victor Baranov 3 years ago committed by GitHub
commit e31dd63617
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 4
      apps/explorer/lib/explorer/chain.ex

@ -6,6 +6,7 @@
### Fixes ### Fixes
- [#4419](https://github.com/blockscout/blockscout/pull/4419) - Order contracts in the search by inserted_at in descending order - [#4419](https://github.com/blockscout/blockscout/pull/4419) - Order contracts in the search by inserted_at in descending order
- [#4418](https://github.com/blockscout/blockscout/pull/4418) - Fix empty search results for the full-word search criteria
- [#4406](https://github.com/blockscout/blockscout/pull/4406) - Fix internal server error on the validator's txs page - [#4406](https://github.com/blockscout/blockscout/pull/4406) - Fix internal server error on the validator's txs page
- [#4360](https://github.com/blockscout/blockscout/pull/4360) - Fix false-pending transactions in reorg blocks - [#4360](https://github.com/blockscout/blockscout/pull/4360) - Fix false-pending transactions in reorg blocks
- [#4388](https://github.com/blockscout/blockscout/pull/4388) - Fix internal server error on contract page for insctances without sourcify envs - [#4388](https://github.com/blockscout/blockscout/pull/4388) - Fix internal server error on contract page for insctances without sourcify envs

@ -1107,7 +1107,7 @@ defmodule Explorer.Chain do
{:some, term} -> {:some, term} ->
query = query =
from(token in Token, from(token in Token,
where: fragment("to_tsvector('english', symbol || ' ' || name ) @@ to_tsquery(?)", ^term), where: fragment("to_tsvector(symbol || ' ' || name ) @@ to_tsquery(?)", ^term),
select: %{ select: %{
contract_address_hash: token.contract_address_hash, contract_address_hash: token.contract_address_hash,
symbol: token.symbol, symbol: token.symbol,
@ -1130,7 +1130,7 @@ defmodule Explorer.Chain do
{:some, term} -> {:some, term} ->
query = query =
from(smart_contract in SmartContract, from(smart_contract in SmartContract,
where: fragment("to_tsvector('english', name ) @@ to_tsquery(?)", ^term), where: fragment("to_tsvector(name) @@ to_tsquery(?)", ^term),
select: %{contract_address_hash: smart_contract.address_hash, name: smart_contract.name}, select: %{contract_address_hash: smart_contract.address_hash, name: smart_contract.name},
order_by: [desc: smart_contract.inserted_at] order_by: [desc: smart_contract.inserted_at]
) )

Loading…
Cancel
Save