472,354 Members | 1,444 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

Matching Specific Ad Based On Various Filters

15
Hi, I need a little help with someting I’d like to implement, but not sure how to do it.

I’m running eBay like classifieds site. There are a lot of filters on my site e.g. you can filter ads by price, by category, by city, by condition…
Let’s say we have this use case:

- User is able to filter ads on my site using filters
- Once he does it he can save those filters and subscribe to get push notification when someone submits an ad that matches those filters
- I save those filters in my database for that user
- For this example let’s say my site has around 100k active subscriptions.

The first step is obviously to attack a place in a code where ad is being saved to the database. I’m having a problem with how to know if that specific ad matches those filters.

I would need to go through 100k subscriptions and their filters to know which filter matches the ad that has been posted. It doesn’t sound too good for me, it could be 1M filters or more.

Can someone help me with that or at least point me to the right direction.

This is basic version.

Filters:
- country, county, city
- min price, max price
- condition (new,old…)
- ads with/without picture

User A subscribed to set of filters:
- England, London
- Min price: 200 €
- X
- X

User B subscribed to set of filters:
- England
- Max Price: 500€
- New
- X

User C subscribed to set of filters:
- Germany
- Min price: 200 €
- X
- With pictures

User X submitted ad with following data:
- City: London
- Price: 300 €
- Condition: New

In this case User A and User B need to get push notification because ad matches their filters.
Sep 27 '20 #1
2 2957
How are you saving the filters to your database? Are you saving each filter to its own field e.g England to country field or you concatenate the filter e.g England, max price €200 before saving to database?
Sep 27 '20 #2
dada1
15
Each ad has columns like:
id | title | country_id | price

But when I save filters to the database (once users subscribe to them) I save it as json object {"price": 500, "country_id": 2}

This can be changed of course if needed
Sep 27 '20 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Matt | last post by:
Hi everyone, still pretty new to MySQL. I was wondering if there is a way to automatically filter records based on a mysql userlogin name?? I have serveral databases that I want to combine in...
1
by: soupaman | last post by:
Im trying to output some filtered xml using the xmlTextReader I know the code and commenting needs cleaned up and eventually plan to add the values to a dataset. currently what this is doing is...
5
by: jim_geissman | last post by:
An application filters records based on names found in them. For example, looking through property buyer names, looking for banks and relocation companies. I have a table of names and patterns:...
8
by: Brian L. Troutwine | last post by:
I've got a problem that I can't seem to get my head around and hoped somebody might help me out a bit: I've got a dictionary, A, that is arbitarily large and may contains ints, None and more...
8
by: mike11d11 | last post by:
I have a dataset with a account table and another table that contains transactions for accounts in the account table. I create a crystal report based off an inner join query of the two tables but...
5
by: favor08 | last post by:
have a mainform called PendingsMain and a subform called PendingsSub. You can filter the subform by different filters and this works fine. i want to create a report that will print out the...
1
by: Yasmeen Pannu | last post by:
HI, I am new to MS Access and stuck in a problem from few days. My Question: I have 3 combo box (Submitter, date from and date to) on my form and i want that when i select values from each of...
1
by: music2451 | last post by:
In my db I need to enter so that I do not get 45's coming back but obviously that also will exclude 54, how do I exclude 45 and not 54 I have tried many combinations of not 45 and 54 but no matter...
10
by: dovidg | last post by:
I have one report with several buttons to open the report based on filters on the buttons. when button "A" is pressed, I want title of report to be "A" when button "B" is clicked, title should be...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.