summaryrefslogtreecommitdiff
path: root/issues/search-results-not-quite-as-expected.gmi
blob: 1a63b11f2e063b842980d96c125b8fd705a30c8f (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Xapian Search Results not Quite as Expected

## Tags

* type: bug
* assigned: arun, fredm
* priority: medium
* status:
* keywords: xapian, search

## Description

The following is a list of failing examples of search, with notes on what I expected.

### Querying by Name

=> https://genenetwork.org/gsearch?type=phenotype&terms=name%3ABXD_24417 with `name:BXD_24417`
=> https://genenetwork.org/gsearch?type=phenotype&terms=species%3Amouse+AND+BXD_24417 with `BXD_24417`
=> https://genenetwork.org/gsearch?type=phenotype&terms=species%3Amouse+AND+24417 with `24417`

To verify that the trait exists, here is
=> https://genenetwork.org/show_trait?trait_id=24417&dataset=BXDPublish the trait page

That also means we cannot do an inverse search, where we say something like
```
species:mouse NOT BXD_24417
```

Here is
=>https://github.com/genenetwork/genenetwork3/blob/98e9726405df3cce81356534335259a446b0c458/scripts/index-genenetwork#L215-L216 some related code
relating to the indexing of the data for search.

### Resolution

Identifiers such as BXD_24417 are arbitrary internal identifiers that hold no meaning outside GeneNetwork. This is unlike something like a PubMed ID that holds meaning outside GeneNetwork. Arbitrary internal identifiers should not be exposed to the outside world.

### `NOT` Operator not Working Right

=>https://genenetwork.org/gsearch?type=phenotype&terms=species%3Amouse+AND+author%3Ahager+NOT+%22BXD+Published%22 Searching by dataset name
works as expected, but should you want to, say, filter out one of the authors, with something like
=>https://genenetwork.org/gsearch?type=phenotype&terms=species%3Amouse+AND+author%3Ahager+NOT+%28%22BXD+Published%22+AND+author%3A%22Lu+L%22%29 this search,
you do not get the expected results.

Changing the search to
=>http://genenetwork.org/gsearch?type=phenotype&terms=species%3Amouse+AND+author%3Ahager+AND+%28NOT+author%3A%22Lu+L%22%29+AND+%28NOT+%22BXD+Published%22%29 more clearly bracketed queries
leads to an outright exception: This should probably be handled.

=>https://genenetwork.org/gsearch?type=phenotype&terms=species%3Amouse+AND+author%3Ahager+AND+NOT+author%3A%22Lu+L%22 Here is another example
of the `NOT` operator acting a little weird: note that phenotypes with "Lu L" as an author still show up.

### Resolution

Due to
=> https://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html#ae96a58a8de9d219ca3214a5a66e0407eacafc7c8cf7c90adac0fc07d02125aed0 performance reasons,
pure `NOT` queries are not supported.

Queries involving author:"Lu L" not working is a bug. This has been moved to a separate bug report.
=> /issues/search-queries-with-quoted-author-names-dont-work

* closed