Avoiding duplicates in drupal 6 views2-relationship-results - drupal-6

I'm trying to build a list using drupal6, views and node reference.
The list should be look like:
vehicle 1
feature 1
feature 2
feature 3
extra 1
vehicle 2
vehicle 3
The vehicle is a custom node-type, feature and extra also. In my view I'm listing all vehicle-node (as fields), added relationships to feature and extra nodes and added the reference-fields.
Now I'm getting the desired list. But when the displayed node contains more than one relationship of the same type (see feature in vehicle 1 in list above) I'm getting one result line per relationship (vehicle 1 get displayed three times).
Is there any way to group these results?

After some longish time searching and trying to implement custom theming solutions to combine the duplicated results, I found a similar question at drupal.org where i found some useful hints:
It seems to be an SQL-related issue (described here) not "solvable" with views2.
I'm now using the Reference view module (http://drupal.org/node/1319746) which allows to set up "child"-views (i.e. features and extras) I can include as fields in my original view (vehicles).

Related

Can I see relationships in the list view in KeystoneJS?

In my KeystoneJS (v4) setup I have the following lists:
Stores
Product Categories
Tags
The stores can have categories associated with them.
If I open up a category I can see it's Relationships (stores that use a certain category).
But, is it possible to see these relationships in the list layout as well? Not seeing it in the docs...
Adding the relationship to the column is not possible.

Microstrategy documents - matching differen attributes with the same value

I'm building a document with a dashboard-like appearance.
I'm using radio buttons for selecting the year.
Sadly in one of my datasets the attribute year is another attribute, even if contains exactly the same values.
How can I solve the problem of matching attributes basing on their values in documents?
Basically i want to click on the radio button 2013 and select the value 2013 in graph1 containing the attribute named year and in graph2 containing the attribute named year-of-observation.
I did as you told me.
I added an advanced qualification fiolter to the report that contains year-of-observation:
[Year]#ID = [Obs-Year]#ID
Then I added the attribute year to the report.
But when i try to execute the report have the following error:
Report: xxxxxxxxxxx
Job: 8600588
Status: Execution failed
Error: SQL Generation Complete
QueryEngine encountered error: The report contains a cross join in pass 1 between tables ANSWERS and YEAR. Execution is aborted per the cartesian join setting..
Error in Process method of Component: QueryEngineServer, Project xxxxxx , Job 8600588, Error Code= -2147212544.
Starting Time: 15:13:50
You can't... or you can try to add the attribute year in the report with year-of-observation and put a filter year = year-of-observation, at this point many things can happen:
If the two attributes have no relationship, the lookup table for year will be added to your report query in cross join, but you don't worry because the filter will limit the results to the right ones.
If one of the attributes is parent of the other you won't have cross join, then remove the filter, but double check the results (just in case)
If Year is already mapped on one of fact tables used by the report you and there is no 1:1 correspondence between year and year-of-observation you could have wrong results.
Also
Assuming Year and year-of-observation have no relationships, if they are mapped on the same lookup column of the same table (no aliases, no role recognition) MicroStrategy will use only one lookup for both attributes so there is no need for the filter.
A word of advise
Anyway it's a good practice to keep different logical entities (like two attributes) separated, but (probably not your case) when they are the same thing just use one.
Advanced level
Another possible solution is to play with relationships: you can try to make the Year parent of year-of-observation, then include the year attribute in the report where is missing, but if this is really feasible depends on your schema, you could end up with messy hierarchies path if you have already children for Year and Year-of-observation.
Cross Join Error
In case you follow solution #1, you could receive an error related to the Cross Join. This happens because the SQL Engine is trying to protect you from Cross Joins (usually a bad thing).
To disable this error you need to change the following VLDB property for the report (or you can change it also at Project level if you have many reports with Cross Join):
VLDB Properties -> Joins -> Cartesian Joins Warning

Solr Schema Advice for Dynamic Facetable Fields

I haven't used Solr for about three years, and I see that it has now jumped up to 3.5.
The "Documents" that I am trying to add to my Index are properties.
The majority of all properties will have about ten of the same types of fields. Such as
Longitude
Latitude
Name
Location Name.. etc
However, I also want to add in attributes about the property which should be facetable.
Property receive features, which are grouped into ten of so categories. Such as...
(Entertainment, Attractions, General, Kitchen, Spa etc). And then the user when adding their property would select items from a pre defined list.
So that for example, if they are adding General features, they might check:
✓ Heating, ✓ Balcony, ✓ Garage, ✓ Washing Machine etc.
Then on my presentation layer, These options might be displayed under the heading General with all of the available facets that fall within the General category.
So, this is my problem... if I make a facet field called "general" I would actually want to add a lot of values to this field. But then can you facet over a multi valued field?
And then I would want to do exactly the same for "spa" where the user might check that the property has a Swimming Pool, Sauna and a load of other features etc.
Any advice as to how I should construct my schema would be appreciated.
Yes, you can facet over multivalued field. Watch this presentation by Solr's developer about facets:
The Many Facets of Apache Solr by Yonik Seeley
I hope that this will have all answers you need. Only thing you need to do in schema is to set the field as multivalued (and maybe also make some processing if this is text not ids, but this is showed nicely in presentation and slides

Invalid Magento Search result

Searching Magento with fulltext search engine and like method , it will store results in catalogsearch_fulltext table in "data_index" field where it stores value in the format like
each searchable attribute is separated with |.
e.g
3003|Enabled|None||Product name|1.99|yellow|0
here it store sku,status,tax class, product name , price ,color etc etc
It stores all searchable attribute value.
Now the issue is for Configurable product , it will also store the associated products name ,price ,status in the same field like
3003|Enabled|Enabled|Enabled|Enabled|None|None|None|None|Product name|Product name|associted Product name1|associted Product name2|associted Product name3|1.99|2.00|2.99|3.99|yellow|black|yellow|green|0|0|0|0
So what happen is if i search for any word from associated product, it will also list the main configurable product as it has the word in its "data_index" field.
Need some suggestion how can i avoid associated products being included in data_index, So that i can have perfect search result.
thanks
We are looking into our search as well and it has been surprising to see the inefficiencies included in the fulltext table. We have some configurable products as well that have MANY variations and their population in the fulltext search is downright horrendous.
As for solutions, I can only offer my approach to fix the problem (not completed: but rather in the process).
I am extending Magento to include an event listener to the process of indexing the products (Because catalog search indexing is when the fulltext database is populated). Once that process occurs, I am writing my own module to remove duplicate entries from the associated products and also to add the functionality of adding additional search keyword terms as populated from a CSV file.
This should effectively increase search speed dramatically and also return more relevent search results. Because as of now, configurable products are getting "search bias" in the search results.
This isn't so much of an answer as a comment, but it was too lengthy to fit in the comments but I thought this might be beneficial to you. Once I get my module working, if you would like, I can possibly give you directions on how you could implement a similar module yourself.
Hope that helped (if only for moral support in magento's search struggle)

Sorting and filtering lists in Orchard

I've followed the topic 'Creating lists' in the Orchard Project docs but I'm struggling to think how best to implement my preferred sort order and direction in the resulting rendering of Summary display of the content items.
For example, if I create a Book Reviews list as in the example, and I then add a Published Date field following the topic 'Creating a custom field type' then how would I alter my theme or the views in the Module to display (and possibly also filter) the content items by that custom field.
The 'Creating lists' topic discusses how widgets can implement sorting and filtering, but not how the main content type can do so.
p.s. if you know the answer to this you're probably well on the way to being able to implement an Event Calendar Module as suggested by the Orchard Module Challenge; why not have a go and stand a chance to win a TV / XBox / KINECT!
Research to date:
I've noticed that ordering in a Container part is implemented using the following property
OrderByProperty
(Orchard.Core.Containers.Models.ContainerPartRecord)
In Orchard 1.4 you can Projection Module to achieve that.
In previous versions, I used LINQ queries to do the sorting on the custom field.

Resources