According to the docs, I could use - to exclude certain things from the search API... I tested it and this works on the language field for example, but doesn't work on topics.
According to the documentation:
note
cats stars:>10 -language:javascript matches repositories with the word "cats" that have more than 10 stars but are not written in JavaScript.
But if I want to search for cats stars:>10 -topic:javascript it doesn't work anymore, although I tested it and there are exactly 9 repositories that have javascript as a topic.
So
cats stars:>10 returns 714 results
cats stars:>10 -topic:javascript returns 714 results (- doesn't work)
cats stars:>10 +topic:javascript returns 9 results
cats stars:>10 -language:javascript returns 602 results (- works as expected)
cats stars:>10 +language:javascript returns 112 results
There's a workaround with GitHub CLI:
Replace: ORG with organization name.
Unix:
gh repo list ORG --json name,repositoryTopics --limit 200 --jq '.[] | select(.repositoryTopics//[] | all(.name != "unwanted-label-name"))' | sort
Windows:
gh repo list ORG --json name,repositoryTopics --limit 200 --jq ".[] | select(.repositoryTopics//[] | all(.name != """unwanted-label-name"""))" | sort
For GitHub enterprise, set environment variable before running commands:
GH_HOST=your.github.enterprise.company.host
Related
Using a keyword ("data analysis") how is it possible to retrieve using github api all commits for this keyword?
Currently the general search provides only the first 1000 commits. Example link https://github.com/search?q=%22data+analysis%22&type=commits
You can use gh api paginate to manage getting all results
gh api search/repositories --method=GET -F q="data analysis" --jq ".items[].html_url" \
-F per_page=100 --paginate --cache 1h
That won't be limited to the first 100.
I have a Solr document whose fields and values are shown below.
and the parsed query which i am trying to Hit to fetch this document is "red tape white casual shoes"-
parsedquery: "+(DisjunctionMaxQuery((keywords_text_en:casual | (brandName_text_en_mv:casual)^3.0 | (name_text_en:casual)^2.0 | (categoryName_text_en_mv:casual)^4.0))
DisjunctionMaxQuery((Synonym(keywords_text_en:boot keywords_text_en:shoe) | (Synonym(brandName_text_en_mv:boot brandName_text_en_mv:shoe))^3.0 | (Synonym(name_text_en:boot name_text_en:shoe))^2.0 | (Synonym(categoryName_text_en_mv:boot categoryName_text_en_mv:shoe))^4.0))
DisjunctionMaxQuery((keywords_text_en:red | (brandName_text_en_mv:red)^3.0 | (name_text_en:red)^2.0 | (categoryName_text_en_mv:red)^4.0)) DisjunctionMaxQuery((keywords_text_en:tape | (brandName_text_en_mv:tape)^3.0 | (name_text_en:tape)^2.0 | (categoryName_text_en_mv:tape)^4.0)) DisjunctionMaxQuery((keywords_text_en:white |
(brandName_text_en_mv:white)^3.0 | (name_text_en:white)^2.0 | (categoryName_text_en_mv:white)^4.0)))~5 DisjunctionMaxQuery(((keywords_text_en:"casual (boot shoe) red tape white"~5)^2.0 | (brandName_text_en_mv:"casual (boot shoe) red tape white"~5)^6.0 | (categoryName_text_en_mv:"casual (boot shoe) red tape white"~5)^8.0 | (name_text_en:"casual (boot shoe) red tape white"~5)^4.0))",
As per my understanding, since the word - "casual" is present in the 'categoryName_text_en_mv' field, and all the other words in other query fields, this query should be able to find this and return in the response.
but the number of documents found is 0. Can someone help me understand what am I missing here?
Thanks in advance!
Edit 1
The interesting thing is when the query is "red tape white shoes", then the expected document is coming in the results. Only when I add 'casual' to the query, it fails. Important observation is that all the other words except causal are present in the single field. I suspect solr is failing to match documents across multiple field
I would suggest you to use the analysis screen . select the field in the drop-down and put the value you are searching in both query and index side to see how it's pipleline is defined .
https://solr.apache.org/guide/6_6/analysis-screen.html
I just reindexed that one particular document and it solved the issue for me. looks like the indexing did not happen properly at solr side.
I'm having sphinx index to search users by names.
I'm using soundex morphology to show more relevant results for case searcher doesn't exactly know how the name spells. Consider following table:
+----+--------------------+
| id | name |
+----+--------------------+
| 1 | Maciej Makuszewski |
| 2 | Dane Massey |
| 3 | Lionel Messi |
| 4 | Mr. No Matches |
+----+--------------------+
With soundex enabled sphinx suggests 1, 2, 3 rows as a relevant result for query messi. Anyway I'd like to show the exact matching first. I mean that if user types messi he wants to see Lionel Messi the first with great probability.
My problem is I don't know how to do that. I tried to set different rankers but it gives nothing.
I also tried to add
index_exact_words = 1
to index but it gives nothing.
I'm using sphinx API with node.js sphinxapi module if it matters.
What is the common way of solving such issue?
You want, index_exact_words, but should also add expand_keywords
This will cause sphinx to search for the fuzzy (via morphology) AND the exact word (via index_exact_words) automatically. So an exact match, matches both, and ranks higher.
Can do the same manually by searching for say
messi | =messi
(which is similar to what expand_keywords does internally)
I'm confused by some Instagram geographic search results I'm seeing. I issue a large query (with lat, lng, and distance=1000) and get one set of photos. I issue a smaller query (with the exact same lat and lng, but distance=800). As expected, the result sets are different, but interestingly the smaller query returns photos that are not returned by the larger query.
To reproduce:
curl -s "https://api.instagram.com/v1/media/search?lat=47.58154&lng=-120.66489&distance=1000&client_id={yourid}" | python -mjson.tool | grep link | sort > large_results
curl -s "https://api.instagram.com/v1/media/search?lat=47.58154&lng=-120.66489&distance=800&client_id={yourid}" | python -mjson.tool | grep link | sort > small_results
Diff the two files, and you'll see photos in small_results that are not in large_results.
Is this expected behavior?
Am I doing something obviously wrong here?
UPDATE: I submitted this question to Instagram. The response: this behavior is "by design". FYI.
Is it possible to somehow construct a Scenario which uses two different Example tables in different steps? Something like this:
Given I log in
When I view a page
Then I should see <goodText>
Examples:
|goodText|
|abc|
And I should not see <badText>
Examples:
|badText|
|xyz|
The scenario above doesn't work, also in reality there would be more rows to each table.
It looks like you're confusing tables with scenario examples. You can mix them, but from your example I'm not sure what you're trying to achieve. Why not just write:
Given I log in
When I view a page
Then I should see "abc"
But I should not see "xyz"
or if you wanted to check for multiple strings:
Given I log in
When I view a page
Then I should see the following text:
| abc |
| def |
But I should not see the following text:
| xyz |
| uvw |
You say that in reality there would be many more rows to the table; but of course a table can also have many columns.
Would this not work for you?
Given I log in
When I view a page
Then I should see <goodText>
But I should not see <badText>
Examples:
|goodText| badText |
|abc | xyz |