greenelab / django-genes

A Django package to represent genes
BSD 3-Clause "New" or "Revised" License
2 stars 3 forks source link

bitbucket: Redundant indexing fields? #8

Open rzelayafavila opened 6 years ago

rzelayafavila commented 6 years ago

Bitbucket issue #7 (priority: minor)

@dongbohu commented: """ Right now haystack builds gene search indexes based on the configurations in three files:

(1) genes/templates/search/indexes/genes/gene_text.txt, whose contents are:

{{object.entrezid}}
{{object.systematic_name}}
{{object.standard_name}}
{{object.description}}
{{object.wall_of_name}}
{{object.aliases}}

(2) models.py: defines the method wall_of_names, which is referred by {{object.wall_of_name}}` in (1). It returns a concatenated string that consists of standard name, systematic name and other cross ref names (if available).

(3) search_indexes.py: defines a GeneIndex class, which includes the following fields:

    text = indexes.CharField(document=True, use_template=True)
    organism = indexes.CharField(model_attr="organism__slug")
    obsolete = indexes.BooleanField(model_attr="obsolete")
    std_name = indexes.CharField(model_attr="standard_name", null=True)

std_name is included in all three configurations, and standard_name and systematic_name are included in both (1) and (2). Are they redundant or included on purpose to boost the fields? We need to dig deeper to figure out, and remove the possible redundancies.

"""

rzelayafavila commented 6 years ago

@mhuyck commented: """ The search_indexes.py file will allow you to do structured searching, if you wish. I believe, for example, that you could write some code to filter results based upon the contents of text, organism, obsolete, and std_name, since they are broken out in search_indexes.py in the example above, but you couldn’t do the same for entrezid because it is part of text.

I have not used that feature of Haystack yet, so I can’t say for sure exactly how it works.

More detail: http://django-haystack.readthedocs.io/en/v2.5.0/searchindex_api.html

"""