Fix empty search results

pull/4418/head
Viktor Baranov 3 years ago
parent b5f952e233
commit ec21aaf3f3
  1. 1
      CHANGELOG.md
  2. 4
      apps/explorer/lib/explorer/chain.ex

@ -6,6 +6,7 @@
### Fixes
- [#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
- [#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

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

Loading…
Cancel
Save