I have been trying for a while now to get asset weighting working with my search engine. I have been using the Search Manager to change asset weights using tree location and specific assets.
For example: I would like a specific standard page to be at the top of my search results when searching for Visual Arts. But, it keeps staying at the bottom no matter what I weight it. Is there somewhere else I need to configure weighting besides in the Search Manager?
No, but you must remember to reindex after you change the weighting. We calculate weights at index time, not search time.
Yes, I have been reindexing each time I have tried to configure. BUT, I have only been reindexing that asset that I set the weight higher on. Do I need to reindex the entire site?!
No, just that asset should be fine. Can you run this SQL command via psql:
[sql]SELECT * FROM sq_sch_idx WHERE assetid LIKE '123''[/sql]
The "score" field should show you the score for that asset by component. It would be valuable to see if the search manager is indexing properly.
[quote]No, just that asset should be fine. Can you run this SQL command via psql:
[sql]SELECT * FROM sq_sch_idx WHERE assetid LIKE '123''[/sql]
The "score" field should show you the score for that asset by component. It would be valuable to see if the search manager is indexing properly.[/quote]
This may sound dumb, but honestly I don't know how to get into psql, Squiz set up our system and I don't even think I know the username and password. Can I run that cmd as root? It has been a while since I messed with postgres.
If you can get to your PostgreSQL server via SSH as the root user, you can run:
# psql -U postgres -l
Which will list out all the databases on your PostgreSQL box. You could also check the DSN lines in main.inc for the name of the active database. Then,
# psql -U postgres databasename
Will log you into a psql console for the database. You can then run the SQL command. :)
[quote]If you can get to your PostgreSQL server via SSH as the root user, you can run:
# psql -U postgres -l
Which will list out all the databases on your PostgreSQL box. You could also check the DSN lines in main.inc for the name of the active database. Then,
# psql -U postgres databasename
Will log you into a psql console for the database. You can then run the SQL command. :)[/quote]
Awesome. I got into the database, but when I run the SQL command I get nothing. Am I correct to replace your 123 with my asset id? I tried it both ways with no output.
Means that nothing is being indexed for that asset ID. If you do a SELECT * FROM sq_sch_idx (without the WHERE clause) do you get any results?
Nope, I am not getting any results for that either.
Which implies that Search Manager is not indexing anything. Can you ensure that Search Manager is enabled on the Details screen? :)
Yes it is enabled. And it HAS to be working since searching works for the site, just not weighting.
Should I have been running that command as the owner of the database? or just as postgres?
I suspect you're looking at the wrong database. Postgres is the superuser and will see everything. If you have nothing in that table, there is no search index and searching should not work.
Perhaps log a support request? :)
[quote]I suspect you're looking at the wrong database. Postgres is the superuser and will see everything. If you have nothing in that table, there is no search index and searching should not work.
Perhaps log a support request? :)[/quote]
Well, there are only 5 databases, and one is called puc_matrix, so I would assume it is that.
I will contact support and see if they can check it out.
Thanks Avi.
Did you have a semicolon at the end of your query? Postgres won't execute the query until it sees one!
There we go! Now I am getting results!
value
| assetid | type_code | component | type | score
----------------------------------------------------------------------------------------------------------
-------------+---------+----------------------------------+--------------------------+-----------+-------
mainland
| 1706 | news_item | attr:body | wysiwyg | 1
chinabr
| 1706 | news_item | attr:body | wysiwyg | 1
pm
| 1706 | news_item | attr:body | wysiwyg | 1
showing
| 1706 | news_item | attr:body | wysiwyg | 2
college
| 1706 | news_item | attr:body | wysiwyg | 1
include
| 1706 | news_item | attr:body | wysiwyg | 2
sport
| 1706 | news_item | attr:body | wysiwyg | 1
fashion
| 1706 | news_item | attr:body | wysiwyg | 1
show
| 1706 | news_item | attr:body | wysiwyg | 1
coordinated
| 1706 | news_item | attr:body | wysiwyg | 1
by
| 1706 | news_item | attr:body | wysiwyg | 3
jana
| 1706 | news_item | attr:body | wysiwyg | 1
wick
| 1706 | news_item | attr:body | wysiwyg | 1
manager
| 1706 | news_item | attr:body | wysiwyg | 1
donna
| 1706 | news_item | attr:body | wysiwyg | 1
karan
| 1706 | news_item | attr:body | wysiwyg | 1
company
| 1706 | news_item | attr:body | wysiwyg | 1
store
| 1706 | news_item | attr:body | wysiwyg | 1
st
| 1706 | news_item | attr:body | wysiwyg | 1
helena
| 1706 | news_item | attr:body | wysiwyg | 1
forested
| 2986 | calendar_event_single | metadata:254 | text | 1Still getting nothing from that specific asset though.