Details
-
Type: Task
-
Status: Closed (View Workflow)
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Story Points:0.25
-
Epic Link:
-
Sprint:Spring 2 : 20 Jan to 31 Jan
Description
When users search the Cytoscape App Store using the name of an author (e.g., "Scooter") or a word that is contained in an App short description (e.g., "adjacency"), results are returned.
When users search the IGB App Store with the name of an author (e.g., "loraine") or a word that is contained in an App short description (e.g., "InterPro"), no results are returned.
It is not clear what the Search feature is actually doing.
For this task, please do two things:
- inspect the IGB App Store code and report back: What is actually getting searched?
- inspect the Cytoscape App Store code and report back: How is search implemented there? Which search tooling are they using - is it still haystack and whoosh?
Each and every Model which is Eligible for search has
1. Search Schema and Search Key which is used by Haystack and Whoosh to do the Searching
Example
```
search_schema = ('fullname', )
search_key = 'name'
```
2. The search is carried out on the dields mention in the file apps/search_indexes.py
```
class AppIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document = True, use_template = True)
Bundle_Name = indexes.CharField(model_attr='Bundle_Name',null=True)
categories = indexes.MultiValueField(model_attr = 'categories', null=True)
stars = indexes.IntegerField(model_attr = 'stars',null = True)
def get_model(self):
return App
def prepare_tags(self, obj):
return [tag.id for tag in obj.categories.all()]
```
3. Search Template can be located at templates/search/indexes/apps/app_text.txt
This file is responsible to handle the Indexing part of the Search when the app is first added to the search index by Whoosh
```
{% for tag in object.app.categories.all %}{{ object.Bundle_Name }}
{{ object.downloads }}
{{ object.stars }}
{{ tag.name }}
{% endfor %}```
Searching can be done on more specific fields if we figure out how the search indexing works and then addig it to Releases model rather than Apps model.