question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Search returns quite small number of results for Multiple Word Queries

See original GitHub issue

Hello again Mr. Stoilov.

I am stuck in yet another issue involving the function Pinterest.search() in Pinterest.py starting from Line 368. I have tried with both branches, the master branch as well as the board-section-refactor branch.

Single Word Query boards_query_result = pinterest.search(scope='boards', query='hello')

returns 250 boards, which is all good. The result is the same as the one returned by the UI. https://www.pinterest.com/search/boards/?q=hello&rs=typed&term_meta[]=hello|typed

But in case of double word query:

Double Word Query boards_query_result = pinterest.search(scope='boards', query='hello world')

returns only 23 boards. Whereas, the expected results should have been: https://www.pinterest.de/search/boards/?q=hello world&rs=typed&term_meta[]=hello|typed&term_meta[]=world|typed

Any idea what might be the issue here? Or what might I be doing wrong this time 😄

Cheers and as always your help is very much appreciated. Thank you.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
bstoilovcommented, Nov 19, 2019

The issue was in my logic for escaping the multi word queries…

this line query = "%20".join(terms) breaks two things:

  • the bookmark key becomes ‘word1%20word2’ and the next bookmark is never loaded, this means that even if there were more results they would never be retrieved
  • the query parameter in the options object send to pinterest should be “word1 word2” and not “word1%20word2” and this was making it being treated a a single word.

I am addressing this in thei PR: https://github.com/bstoilov/py3-pinterest/pull/24

Can you also check if I missed something?

0reactions
bstoilovcommented, Nov 19, 2019

Great I will merge the PR then, glad to be of help

Read more comments on GitHub >

github_iconTop Results From Across the Web

1. Refining Your Searches - Google Power Search [Book]
The first key to refining a search is to use a multiple-word query. ... a market research query returns many more (but less...
Read more >
Using Lookup and multivalued fields in queries
In Access, you can create a multivalued field that holds multiple values (up to 100). You can also create a Lookup field that...
Read more >
The 3 Types of Search Queries & How You Should Target Them
Search queries – the words and phrases that people type into a search box in order to pull up a list of results...
Read more >
Use of indexes for multi-word queries in full-text search (e.g. ...
To answer the query for that word the solution is just to find the correct entry in the index (which takes O(log n)...
Read more >
Multiple Key Words Search with Power Query - YouTube
If you wanted to search for some keyword(s) you could use Ctrl+F (and select Find All) to do this. If there was one...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found