juliomalegria / python-craigslist

Simple Craigslist wrapper
MIT No Attribution
387 stars 165 forks source link

search_titles option #104

Closed usctzen closed 3 years ago

usctzen commented 3 years ago

Hi and thanks again for this great tool.

I am using the search_titles option for a keyword and I have come to realize that it may not be working properly.

As an example, am using the keyword 'Softail' to search for Harley bikes and it does flag the ones with Softail in the title.

Here is a sample of the code I use.

image

Could you check or tell me what I am doing wrong?

irahorecka commented 3 years ago

Hello @usctzen, it looks like your program is OK. Are you seeing issues where you set search_titles: True but receive results where "Softail" is in the model of the post and not in the title?

usctzen commented 3 years ago

Hi Ira,

Actually, I understood that I was searching for the model, but also searched in the title in case the model wasn't filled properly.

I do get results like that. I have always assumed that if found they were at le found in the category.

Here is a sample


SOFTAIL (MAX $6000)

2001 HARLEY DAVIDSON | Price $5,800 | Location WEST PALM BEACH https://miami.craigslist.org/pbc/mcy/d/west-palm-beach-2001-harley-davidson/7253630894.html

HARLEY HERITAGE SOFTAIL 2002 | Price $5,500 | Location HOLLYWOOD https://miami.craigslist.org/brw/mcy/d/hollywood-harley-heritage-softail-2002/7253302130.html

HARLEY DAVIDSON 2004 | Price $5,999 | Location PALM BEACH CO https://miami.craigslist.org/pbc/mcy/d/lake-worth-harley-davidson-2004/7248461620.html

HARLEY HERITAGE SOFTAIL CLASSIC 1993 | Price $5,200 | Location CLEWISTON https://miami.craigslist.org/brw/mcy/d/harley-heritage-softail-classic-1993/7247165096.html

Le lun. 4 janv. 2021 à 19:40, Ira Horecka notifications@github.com a écrit :

Hello @usctzen https://github.com/usctzen, it looks like your program is OK. Are you seeing issues where you set search_titles: True but receive results where "Softail" is in the model of the post and not in the title?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/juliomalegria/python-craigslist/issues/104#issuecomment-754144284, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADXNCULFDIW5L5CH3ADNRVDSYIDQFANCNFSM4VTIHTWA .

usctzen commented 3 years ago

Ira,

I just ran a test with the filter set to False and I get the exact same result. Like if the filter is not functioning.

Thanks for your help

Le lun. 4 janv. 2021 à 19:40, Ira Horecka notifications@github.com a écrit :

Hello @usctzen https://github.com/usctzen, it looks like your program is OK. Are you seeing issues where you set search_titles: True but receive results where "Softail" is in the model of the post and not in the title?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/juliomalegria/python-craigslist/issues/104#issuecomment-754144284, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADXNCULFDIW5L5CH3ADNRVDSYIDQFANCNFSM4VTIHTWA .

juliomalegria commented 3 years ago

Hi @usctzen.

Just to clarify, the search_titles filter works only in combination with the query filter. By itself, the search_titles will just be ignored.

So for example, an instance with (..., filters={'query': 'spacious', 'search_titles': True}) will only return entries that contain the word "spacious" on their titles.

Does that make sense? I think that should explain the issue you're having.

usctzen commented 3 years ago

Ok, thanks for the clarification. I'll try to see if I can use it.

Thanks again for a great product and should I make some money with it, I would love to contribute something.

Le lun. 4 janv. 2021 à 21:59, Julio M. Alegria notifications@github.com a écrit :

Hi @usctzen https://github.com/usctzen.

Just to clarify, the search_titles filter works only in combination with the query filter. By itself, the search_titles will just be ignored.

So for example, an instance with (..., filters={'query': 'spacious', 'search_titles': True}) will only return entries that contain the word "spacious" on their titles.

Does that make sense? I think that should explain the issue you're having.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/juliomalegria/python-craigslist/issues/104#issuecomment-754215286, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADXNCUO2XRYC2YPACQCNHD3SYIT2RANCNFSM4VTIHTWA .

juliomalegria commented 3 years ago

Let me know if that works for you. I'll close this issue for now. If you encounter any issue, feel free to re-open it.